A German train operator has announced it is introducing a women-only carriage on its trains following several violent sex attacks.

Mitteldeutsche Regiobahn will introduce the option for women passengers on the Leipzig to Chemnitz line, positioning the carriages next to the train conductor.

“The local proximity to the customer service representative is chosen deliberately,” a Mitteldeutsche Regiobahn spokesman said.

The carriages are designed to make solo female travellers or women with young children feel safer on trains.

Boys up to the age of ten will also be allowed to ride in the special carriages.

There were several sex attacks against women in Germany on New Year's Eve, widely blamed on migrants who had recently arrived in the country.

In Cologne, a crowd of some 1,000 men “of North African or Arab appearance” was able to mass around the city’s main train station, with roving gangs allegedly assaulting dozens of women with impunity.