Greek police said on Tuesday that an 89-year-old man has been taken into custody for a mass shooting in Athens that injured five people.

The suspect first appeared on security cameras approaching EFKA, the social security office in the Kerameikos district of Athens, calmly strolling across the street with a shotgun in hand. He entered the EFKA office on the fourth floor of the building, told one of the employees to “duck,” and then fired a shot that hit another employee in the leg. An eyewitness said he appeared to have chosen his target at random.

The gunman then caught a taxi to a court building in the nearby district of Ambelokipi and discharged his weapon into the floor of an office, injuring four female employees. He threw some envelopes on the floor, shouting that their contents would explain his actions, and then fled the scene, leaving his shotgun behind.

According to the Athens-based union for judiciary employees, the four “slightly injured” victims at the courthouse were “women working at the small claims court.”

An intense manhunt was launched for the suspect and he was soon taken into custody at a hotel in the city of Patra, about 130 miles west of Athens. Police said a second weapon, a .38 revolver, was discovered when he was arrested.

Local media reports described the elderly suspect as a garbage collector living in the Athens area who had received treatment at a mental hospital in 2018. Greek state media reported that the suspect’s niece contacted police to identify him when she saw him in reports of the shootings.

Greek news site Ekathimerini reported that the suspect’s license for a shotgun was stripped after he was treated for mental illness, and the shotgun he owned at the time was confiscated, so he must have conducted Tuesday’s attack with a different weapon.

According to Ekathimerini, the reason the man was diagnosed with mental health issues in 2018 was that he left two bullet casings outside a prosecutor’s office after his application for a Greek pension was denied.

The UK Independent cited Greek media reports that said the gunman “had received a pension from the U.S. and Germany, and had applied for eligibility in Greece,” but his claim was rejected in 2016, and his appeal was rejected two years later. It was not immediately clear why he would have collected pensions in the U.S. or Germany.

The Independent reviewed a handwritten letter penned by the suspect, dated April 25, in which he said a “thick folder with over 150 documents” would soon be published by the newspapers. He also reportedly told a taxi driver on Monday, “You’ll see what I’ll do tomorrow.” These accounts would suggest the shootings were meant to draw attention to his pension grievances.