KIEV, Ukraine (AP) - Thousands of people attended a gay pride parade in Ukraine's capital amid tight security Sunday.

A counterdemonstration by a few hundred ultranationalists resulted in scuffles with police in which two officers were injured and six people arrested, Kiev police chief Andrei Krishchenko said.

Much of downtown Kiev was cordoned off and about 5,000 police officers were on duty for the gay pride march, which has traditionally been a focal point for attacks by ultranationalists.

People take part in the annual Gay Pride parade, being protected by riot police in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Kiev police spokeswoman Oksana Blishchik wrote on Facebook that about 2,500 people attended. The route of the parade was changed at the last minute in an attempt to head off clashes.

People marched in colorful costumes and with rainbow flags and placards, including one that read "Love and let love."

The ultranationalist group Right Sector had warned the day before that their supporters would ensure the parade ended in a "bloodbath."

Kiev held its first major pride march last year after a pro-Western government that came to power after the 2014 revolution sanctioned such events.

Previous gay pride rallies in Ukraine have ended in violence. In 2015, a gay pride march was called off when right-wing activists pelted participants with smoke grenades.

Police arrest anti-gay protesters during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Ukrainian ultra nationalist activists trample a rainbow flag as they protest against the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Ukrainian police guard the participants of the annual Gay Pride parade in Ukraine's capital Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand gays and lesbians activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

People take part in the annual Gay Pride parade, being protected by riot police in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

People take part in the annual Gay Pride parade, being protected by riot police in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

People take part in the annual Gay Pride parade, being protected by riot police in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Participants of the annual Gay Pride parade wave from a float in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Gay and lesbian rights activists demonstrate during the annual Gay Pride parade, being protected by riot police in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Gay and lesbian rights activists march with a rainbow flag during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand gays and lesbians activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Gay and lesbian rights activists demonstrate during the annual Gay Pride parade, being protected by riot police in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand gays and lesbians activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Gay and lesbian rights activists demonstrate as participants of the annual Gay Pride parade wave from a float in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand gays and lesbians activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Participants of the annual Gay Pride parade wave from a float in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand gays and lesbians activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Ukrainian police guard the participants of the annual Gay Pride parade in Ukraine's capital Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand gays and lesbians activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Gay and lesbian rights activists demonstrate in the streets of the capital during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand gays and lesbians activists and associations paraded in the center of Kiev. (AP Photo/Efrem Lukatsky)

Ukrainian ultra nationalist activists shout slogans as they protest against the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. AP Photo/Sergei Chuzavkov)

Riot police clash with ultra nationalist and anti-LGBT protesters during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Police arrest anti-gay protesters during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Riot police clash with ultra nationalist and anti-LGBT protesters during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Riot police clash with ultra nationalist and anti-LGBT protesters during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Riot police clash with ultra nationalist and anti-LGBT protesters during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Riot police clash with ultra nationalist and anti-LGBT protesters during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Police block ultra nationalist and anti-LGBT protesters during the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Ukrainian ultra nationalist activists burn a rainbow flag as they protest against the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)

Ukrainian ultra nationalist activists shout slogans as they protest against the annual Gay Pride parade in Kiev, Ukraine, Sunday, June 18, 2017. Around five thousand LGBT activists and associations paraded in the center of Kiev. (AP Photo/Sergei Chuzavkov)