RIO DE JANEIRO (AP) — Nijat Rahimov of Kazakhstan was a surprise gold medalist in weightlifting on Wednesday, but immediately faced questions over doping.

Rahimov, who only returned from a doping ban last year, and the rest of Kazakhstan's team had almost been excluded from the Rio Olympics entirely after repeated failures in retests of doping samples from the 2008 and 2012 Olympics. The country stands to lose five gold medals from those games.

Kazakhstan was allowed to compete because those doping cases were not fully processed in time for the games, the International Weightlifting Federation has said.

In a sport in crisis over doping, Rahimov's world record-breaking performance in the 77-kilogram class Wednesday is unlikely to silence the critics, not least bronze medalist Mohamed Mahmoud of Egypt, who said he found Rahimov's dramatic improvement since his ban suspicious.

Rahimov was banned for two years in 2013 after failing a test while competing for Azerbaijan, another country with longstanding doping problems. Rahimov was one of 18 Azerbaijanis busted that year. Rahimov was born in Azerbaijan and recently moved to Kazakhstan to compete on its weightlifting team.

China's Lyu Xiaojun had been the favorite to retain the gold he won in 2012 and began to celebrate prematurely after his final lift, stripping to the waist in front of the crowd. But Rahimov had other plans, audaciously moving up 12 kilograms for his next attempt at the clean and jerk to 214kg, breaking a 15-year-old world record.

That gave him a total of 379kg from the two phases of the competition, level with Lyu but enough for Rahimov to take gold because he had weighed in lower.

He celebrated by crouching into a pose of prayer before being tackled in a bearhug by his coach, while Lyu gave a wry smile for the cameras.

Rahimov repeatedly dodged questions about his doping past after the win, crediting religion and a tough training schedule for his success.

"When normal people were asleep, we were training. When the snow was deep — you know how it is in Kazakhstan — we went out for training at 11 or 12 (at night)," he said. He added he had treated Kazakhstan's possible ban from Rio Olympic weightlifting as "a rumor" and was not distracted from training.

Bronze went to Egyptian Mohamed Mahmoud on 361. Mahmoud said the talk of drugs could not be avoided in light of Rahimov's win.

"Maybe after some doping controls, some things will change," Mahmoud said. While improvements like Rahimov's can be the result of good training and nutrition, Mahmoud said, "in a very short time it cannot happen like that."

Wednesday's doping controversy came as weightlifting already faced a storm of doping scandals.

On Tuesday, Taiwanese gold medal contender Lin Tzu-Chi was withdrawn from competition hours before her event for what her team called abnormalities in a drug test, and the Polish weightlifting federation's head has resigned after what he said were two more failed tests, one of a lifter who was due to compete in Rio.

Earlier Wednesday, China's Xiang Yanmei took gold in the women's 69-kilogram class despite having taken a blow to the head when she dropped the bar halfway through the competition.

Xiang briefly appeared dazed and admitted to some pain but was fully alert as she closed out China's fourth weightlifting gold of the Rio Olympics with 116kg in the snatch and 145 in the clean and jerk for a total of 261.

"I got hurt a little bit and I feel hurt when I nod my head," she said. "I didn't think about it when lifting weights." Xiang said she had not seen a doctor.

She added Olympic gold to the world titles she won in 2013 and 2015, and continued a resurgence for China's lifters in Rio following a slow start.

The silver medal went to Kazakhstan's Zhazira Zhapparkul with a 259 total, while Egypt's Sara Ahmed won bronze with 255 kilos, becoming the first woman from an Arab country to win an Olympic weightlifting medal.