"After much consideration, I have decided not to play in the Open Championship at St. Andrews," the world number one said Wednesday on his Twitter and Instagram accounts.
"I'm taking a long term view of this injury and, although rehab is progressing well, I want to come back to tournament play when I feel 100% healthy and 100% competitive.
"Thank you for all your support and best wishes. I hope to be back on the course as soon as I can."
"Total rupture of left ATFL (ankle ligament) and associated joint capsule damage in a soccer kickabout with friends on Saturday," he said.
More From This Section
"Continuing to assess extent of injury and treatment plan day by day. Rehab already started..... Working hard to get back as soon as I can."
He also posted a photograph on Instagram showing himself on crutches and wearing a protective boot.
McIlroy quickly pulled out of this week's Scottish Open at Gullane and it was immediately clear that the extent of the injury made it highly unlikely that he would be able to tee off in the Open championship first round next Thursday.
"Rory will play in many more Open Championships and our primary concern is for his complete recovery.
"Everyone associated with The Open wishes Rory the very best as he looks to return to full fitness.