"After much thought and deliberation, I have decided to withdraw my name from consideration for this summer's Olympic Games in Rio de Janeiro," the 27-year-old four-time major champion said in a statement.
"After speaking with those closest to me, I've come to realise that my health and my family's health come before anything else.
"Even though the risk of infection from the Zika virus is considered low, it is a risk nonetheless and a risk I am unwilling to take.
The decision by McIlroy -- the latest of several major winners to announce they would not go to the Games despite it returning to the quadrennial sports extravaganza for the first time since 1904 -- left the Olympic Council of Ireland (OCI) dejected.
More From This Section
"The OCI is extremely disappointed not to be taking Rory with us to Rio," read a statement from the Council, whose president is IOC Executive Board member Pat Hickey.
"Rory was set to be one of the big stars of Rio 2016, but now there is an opportunity for another Irish golfer to take up the chance to become an Olympian and participate in golf's historic return to the Olympic Games after a 112-year absence.
"The OCI and our medical team have taken our lead from the IOC on the Zika situation, as we do in all matters. They have provided us with every assurance and we have total confidence that the Games will be safe for all athletes."
Replacing McIlroy will probably be his Ryder Cup team-mate and fellow Northern Irishman Graham McDowell alongside the higher-ranked Shane Lowry, who led the US Open going into the final round last Sunday.
More than 60 countries and territories have been affected by the ongoing Zika outbreak. Most of them are in Latin America, the Caribbean and the South Pacific.
The mosquito-borne Zika virus can cause the birth defect microcephaly, leading babies to be born with unusually small heads and deformed brains.