Hungarian swimmer Tamas Kenderesi was charged with sexual harassment following the world championships in South Korea (AFP Photo/Odd Andersen)

Hungarian swimmer Tamas Kenderesi, who has been competing at the world championships in South Korea, has been banned from leaving the country after being arrested for alleged sexual harassment, police said Sunday.

Local police are investigating allegations against the Olympic bronze medallist, who was detained and questioned over an incident at a nightclub in Gwangju, some 330 kilometres (200 miles) south of Seoul, a police official told AFP.

Hungarian team officials and swimming's governing body FINA confirmed that Kenderesi had been released from custody and returned to the athletes village, but he would not be allowed to leave the country for the next 10 days.

"The Hungarian swim federation, in cooperation with staff at the Hungarian embassy in Korea, is doing its best to clarify the allegations against Tamas Kenderesi," Hungary's swimming federation said in a statement.

"During the investigation, the athlete is entitled to a presumption of innocence, but if formally found guilty the federation will seek further action.

"The Hungarian swimming federation condemns any act that violates human dignity, and requires that members of the national swim team behave in a manner that is respectful of national colours and sports traditions."

Kenderesi, who took bronze in the men's 200 metres butterfly at the 2016 Rio Olympics and is the European silver medallist, has denied the allegation, according to local media.

The 22-year-old finished last in the world championship final of the 200m fly earlier this week.

FINA executive director Cornel Marculescu told AFP: "For now he is free but he cannot travel out of Korea. We will see what the next step is."

Kenderesi's arrest comes a day after an indoor balcony at a Gwangju nightclub collapsed, killing two local people and injuring several athletes competing at the world championships.