Photo/Illutration Australia’s Nick Kyrgios plays a return to Canada’s Felix Auger-Aliassime during the men’s singles third round match on day six of the Wimbledon Tennis Championships in London, July 3. (AP Photo)

SYDNEY--Nick Kyrgios pulled out of Australia’s tennis team for the Olympics hours after Tokyo’s governor confirmed a ban on fans in the city’s stadiums during the games which start July 23.

Kyrgios posted a statement on social media early Friday local time to announce his withdrawal, citing a need to get healthy and the ban on fans at Tokyo Olympics venues as reasons.

“It’s been my dream to represent Australia at the Olympics and I know I may never get that opportunity again,” Kyrgios posted. “But I also know myself. The thought of playing in front of empty stadiums just doesn’t sit right with me. It never has.”

The 26-year-old Australian, who also missed the 2016 Olympics in Rio de Janeiro, said he also “wouldn’t want to take an opportunity away from a healthy Aussie athlete ready to represent the country.”

At Wimbledon last week, Kyrgios had to retire after the second set of his third-round match against Felix Auger-Aliassime because of a strained abdominal muscle.

He said it was a heartbreaking way to lose, and later foreshadowed his Olympic decision when he said if he played in Tokyo, he wanted to do it with full crowds, with his support team there and he wanted to be able to watch other athletes compete.

A ban on foreign fans was imposed earlier this year but local organizers had hoped to have local spectators for events in venues up to 50 percent capacity.

The decision to ban fans from all the Tokyo area Olympic venues came after Prime Minister Yoshihide Suga put the Japanese capital under a COVID-19 state of emergency because of rising new infections and the highly contagious delta variant. That means the Tokyo Games will be a largely TV-only event.

Kyrgios has stayed mainly in Australia during the pandemic and skipped the French Open before traveling to Wimbledon.

“I will also take all the time I need to get my body right,” he said in the statement posted on Twitter. “Good luck to all the Aussies competing and I’ll see you back on the court real soon.”