Image copyright AP Image caption Police teams conducted an extensive search for the suspect

Police in New Zealand have detained a man suspected of shooting two people dead and injuring a third at an unemployment office.

The incident happened on Monday morning in the town of Ashburton, southwest of Christchurch.

A man went into a Work and Income New Zealand office and opened fire, before fleeing.

Two people were killed and a third person was in a "serious but stable condition", local police said.

Police said the man left the scene on a bicycle and warned residents not to approach him.

But after an approximately seven-hour search, a suspect was apprehended.

The suspect was found on a rural property and brought down by police dogs.

He sustained dog bites and was being brought to Ashburton police station for a medical examination.

Police were still searching for the weapon used in the shootings, a statement said.

Ashburton is a small town of less than 20,000 people, about 85km (55 miles) from Christchurch.

Image copyright AP Image caption Police said the suspect was brought down by dogs after a seven-hour search

Police initially identified the man as 48-year-old John Henry Tully, but in a subsequent statement used the name Russell John Tully. Local papers say he uses John as a first name.

Earlier this month, the Ashburton Guardian had reported on the case of Mr Tully, who was on disability benefit and was living rough after falling out with his flatmate.

According to the daily, he was seeking help from social services to find affordable accommodation.