Anita Alvarez Rescued During Artistic Swimming Finals

An artistic swimmer nearly lost her life after passing out in the pool following an intense routine at a major event Wednesday … but, thankfully, her coach quickly dove into the water and rescued her.

The terrifying scene went down at the FINA World Aquatic Championships in Budapest, Hungary … when American Anita Alvarez had just wrapped up a performance in the women’s solo free event and suddenly fainted.

The photos from the pool are horrifying … they show a lifeless Alvarez sinking to the bottom, clearly in danger of drowning.

Anita Alvarez

Fortunately, her coach, Andrea Fuentes, immediately knew something was wrong … and jumped in to save her.

Fuentes grabbed Alvarez, pulled her to the top … and, according to U.S. Artistic Swimming officials, the 25-year-old swimmer is now expected to be OK despite the grim images.

"Anita has been evaluated by medical staff and will continue to be monitored," the team said in a statement Thursday morning. "She is already feeling much better and using today to rest."

Fuentes, meanwhile, spoke about her heroic efforts to BBC on Thursday morning … saying she had to rub Alvarez’s face to get her to release the water she had taken into her lungs after collapsing in the pool.

"She was very tight on her jaw," Fuentes said. "So I tried to wake her up and massage the jaw because it was too tense. And then she coughed and threw up the water out."

Shockingly, this is not the first time Alvarez has needed Fuentes to rescue her … the swimmer had a similar incident go down last year at an Olympic qualification event.

U.S. Artistic Swim officials said there is now a chance Alvarez could still compete in Friday’s team event.

They added they’re "immensely thankful" to Fuentes for her "genuine love and urgency" in the horrifying moment at the pool.