A man shot and killed two people near the town of Ansbach in northern Bavaria and the suspect was under arrest, German police said on Friday.

The gunman shot a woman from his silver Mercedes convertible in Leutershausen-Tiefenthal and later shot a cyclist in nearby Rammersdorf, police in southern Germany said.

The man also appears to have shot at two other people, a farmer and another motorist, but they were unhurt, police said.

Local media reported that the suspect was detained at a petrol station in Bad Windsheim, several kilometres (miles) to the north of Ansbach.

Police plan to hold a news conference on Friday afternoon.