Updated

A 23-year-old gunman wounded a man at an office building in Finland on Friday, then traveled to a nearby school and opened fire on a classroom, police said.

No one was hurt at the junior high school, and the attacker quickly surrendered . Police did not identify the gunman but said he had no criminal record.

The suspect could be charged with attempted murder and endangering the public.

Detective Chief Inspector Jari Kinnunen said the two shootings were connected, but he refused to comment on local media reports that the gunman had gone to the school in search of a former girlfriend after wounding her father at the office building. "I cannot fully confirm those details until we have concluded questioning all parties," Kinnunen told The Associated Press.

The attacker, who had licenses to carry three hunting firearms, shot and wounded a 50-year-old man in the arm at the office building in the town of Orivesi on Friday morning, Kinnunen said.

The gunman then traveled to the nearby school and "fired at least four times with a hunting rifle through the classroom door from the corridor," Kinnunen said. "He surrendered later without resisting arrest."

There was at least one teacher and several students in the classroom at the time, Kinnunen said.

"It's not entirely clear what happened at the school" in Orivesi, which is 120 miles north of Helsinki, the officer said. "We are still talking to the staff and students at the school and have forensic teams on the scene. All the staff and students are safe."

In Finland, a country of 5.4 million people with strong hunting traditions, there are 650,000 officially recognized gun owners.

In the last two years, the nation has seen two deadly school shootings.

In 2008, a culinary student killed nine fellow students and a teacher before shooting himself at a vocational school in the western town of Kauhajoki.

A year earlier, an 18-year-old killed six fellow students, a nurse and the principal at a high school in Tuusula, about 30 miles north of Helsinki, before shooting himself.

After those deadly attacks authorities took steps to improve safety at schools, including installing monitoring cameras and locks on classroom doors and training staff to deal with shootings.

"There is still a lot of room for improvement," Interior Minister Paivi Rasanen said Friday. "We really have to carefully evaluate the incident (in Orivesi), but the initial information I have is that staff had acted in the correct manner."