ASABA, Nigeria (AP) — Caster Semenya won the 400 meters at the African championships on Friday and said she still plans to compete in middle-distance races at the 2020 Tokyo Olympics despite new IAAF rules starting in November that could prevent her running in her favored events.

The world and Olympic 800-meter champion displayed her ability across a wide range to set a South African record of 49.96 seconds and win gold in Asaba, Nigeria. She finished well clear of Botswana's Christine Botlogetwe, who was second in 51.19. Nigeria's Yinka Ajayi was third in 51.34.

This year's African championships was the first time Semenya had run the 400 at a major international meet.

"I've run 400 meters previously, I just haven't really done it at competitive level," Semenya said. "But for me it's not about who I'm running against, it's just about me doing what I can do best."

Dominant again this year, Semenya has the fastest times in the world in the 800 and 1,000 meters and now holds the South African records in the 400, 800, 1,000 and 1,500 meters. The South African 400-meter record had stood for 18 years until Semenya took 0.09 seconds off the mark set by Heide Seyerling at the 2000 Sydney Olympics.

But in the latest threat to her tumultuous career, the 27-year-old Semenya could be stopped from competing in distances from 400 meters up to the mile after the IAAF introduced new rules barring women with high levels of naturally occurring testosterone from those events unless they reduce their testosterone levels. The rules come into effect Nov. 1. Semenya has said she will challenge them at the Court of Arbitration for Sport.

Semenya is believed to have a condition known as hyperandrogenism, which leads to high levels of naturally-occurring testosterone. The IAAF's new rules say female athletes with high levels of testosterone have an unfair advantage over those with levels in the normal range, particularly in distances between 400 meters and one mile. Semenya is not the only female athlete believed to have the condition but she's easily the most high-profile.

Should the regulations be implemented, Semenya's options would be to take medication to reduce her testosterone levels for six months prior to competing or switch to the 100 and 200 meters or the 5,000 meters and longer. Her abilities at those distances are untested.

Semenya said in Nigeria she was still focused on the middle-distance events.

"I've still got a lot more goals," she said. "I've mentioned before that my goal is to run until I'm 40, so hopefully there's still three Olympics to come, but we're going to continue to focus on the 400m, 800m and 1 500m."

She is also due to defend her 800 title at the African championships.

Semenya has been a problem for the IAAF ever since she arrived on the international scene as an unknown 18-year-old and won the 800-meter title at the 2009 world championships in Berlin in a blisteringly quick time. She underwent sex tests at those championships and was prevented from competing for nearly a year after as the IAAF considered what to do.

Her case led the IAAF to first introduce testosterone regulations for female athletes in 2011, but those rules were suspended by the Court of Arbitration for Sport in 2015 after an appeal by Indian sprinter Dutee Chand.