BERLIN—An easyJet PLC plane traveling to London Stansted Airport from Ljubljana, Slovenia, on Saturday night diverted and made a sudden landing in Cologne, Germany, amid suspicions three men on board posed a threat to the aircraft, German police said.

The three men were arrested and being interrogated at police headquarters early Sunday morning, according to a spokesman for the state police in North Rhine-Westphalia. The men were being investigated “on the suspicion of preparing a serious antistate act of violence,” the state prosecutor and police said in a joint statement.

The men had yet to be charged and the investigation was ongoing, the police spokesman said.

According to the local prosecutor and police in Cologne, passengers on board alerted the flight crew that the men were “talking about terrorist content.”

The plane’s captain decided to land as a precaution, said Carinne Heinen, a spokeswoman for easyJet.