In the days following Zac Efron's swimming accident, we're learning more about what caused the actor to be hospitalized in Spain.

An inside source confirmed to People magazine that Efron and his friends, who were staying at a villa in Ibiza, went to go swim in the property's pool. 

Efron reportedly dove into the water, knocking his chest against the bottom of the pool and ingesting water into his lungs.

ZAC EFRON BREAKS SILENCE AFTER ACCIDENT IN IBIZA POOL LANDED HIM IN THE HOSPITAL

Zac Efron in a black shirt and grey suit looks up as he waves to the crowd at a premiere

Zac Efron was taken to the hospital in Ibiza after his chest made direct contact with the bottom of a pool. (VALERIE MACON/AFP via Getty Images)

Security at the Spanish villa noticed the 36-year-old actor in distress, and helped to pull him out of the water. Efron was in a brief daze after being removed from the pool, and taken to the hospital for cautionary purposes.  

According to People magazine's source, he had X-rays taken of his chest to make sure no water was left in his lungs and was medically cleared within hours of his arrival. Efron's departure was stalled due to paparazzi that had followed him to the hospital. He left once they were gone. TMZ first reported the news.

Zac Efron looks slightly back at the camera in a navy velvet suit on the carpet

Zac Efron reportedly had X-rays taken of his chest to make sure there was no excess water in his lungs. (Dimitrios Kambouris/Getty Images for National Board of Review)

LIKE WHAT YOU’RE READING? CLICK HERE FOR MORE ENTERTAINMENT NEWS

On Monday, Efron shared a photo that indicated he was in good physical health.

"Happy and healthy - thanks for the well wishes," he wrote in a photo shared to his Instagram stories. In the photo, a shirtless Efron basks in the sun while lifting weights.

Zac Efron lying back on a pink ball lifting weights shirtless

Zac Efron posted a brief update on his health to his Instagram story. (Zac Efron Instagram)

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

A representative for the actor previously told People magazine on Saturday that Efron experienced a "minor swimming incident" in a pool at his Ibiza villa. His rep confirmed that Efron was taken to the hospital, although only for precautionary reasons. "He is fine," they said of the 36-year-old.

The night before the incident, Efron appeared to be in good spirits. In video posted to TikTok, the "High School Musical" actor can be seen partying at the Ushuaïa Ibiza Hotel and Beach Club, dancing on stage with DJ Martin Garrix, who performs on Thursdays.

Like many other Hollywood hunks, Efron has been spotted in a slew of cities this summer, including Paris and St. Tropez.

Zac Efron in a navy suit and blue shirt looks up slightly and smiles

Zac Efron reportedly waited for the paparazzi to leave before leaving the hospital. (TOMMASO BODDI/AFP via Getty Images)

CLICK HERE TO GET THE FOX NEWS APP

A representative for Efron did not immediately return Fox News Digital's request for comment.