A 23-year-old police officer has been killed and 25 people injured in what Ukrainian officials have called a terror attack in the western city of Lviv.

Two homemade explosive devices detonated after police crews responded to a reported break-in shortly after midnight on Sunday, the National Police of Ukraine said. The devices were planted in waste bins, it added.

Eleven people were admitted to hospital, six of whom were law enforcement officers in a serious condition, police said.

President Volodymyr Zelensky confirmed "an individual suspected of carrying out the terrorist attack" had been detained. Lviv Mayor Andriy Sadovyi said she was a Ukrainian woman.

The victim of the attack was named as Viktoria Shpylka.