A man has been taken to hospital with life-threatening injuries after he was shot in a solicitor's office in a quiet market town.

There were unconfirmed reports that the man was an employee and was shot in the head as he sat at his desk at Morris, Goddard and Ward on St John's Street, in Devizes, Wiltshire.

The victim was airlifted to Frenchay hospital in Bristol shortly before 3pm and a man was arrested by armed officers in connection with the shooting 40 minutes later.

A Wiltshire police spokeswoman said the victim sustained "what are believed to be life-threatening injuries" and that officers had recovered a weapon. She did not confirm the identity of the victim or his job.

Simon Fisher, deputy town clerk at Devizes town council, said: "Someone came into the town hall and said there had been a shooting.

"A short time before that some of us heard a bang – it sounded like a car backfiring or a car bumping into another car. One of our staff saw a male being carried out on a stretcher. The area around the town hall is cordoned off."

Colin Garrett, manager of the Edwin Giddings pub, added: "It's a bit of a shock; it's not the sort of thing you would expect here. Details are sketchy but apparently someone walked in with a shotgun and discharged it. I'm not sure if he [the victim] was the intended target or if they were trying to defuse the situation. Unfortunately solicitors deal with stressful situations that they are trying to sort out. The police are not letting anyone near the scene as they are gathering evidence."

An ambulance reached the victim just six minutes after the first 999 call was made. A spokesman for Great Western Ambulance Service said: "We received a 999 call at 2.58pm reporting a man had been injured in an incident involving a firearm. A paramedic in a rapid-response vehicle was on scene at 3.04pm, backed up by other resources, including ambulance crew, a doctor, air ambulance and duty officers. The patient sustained serious, life-threatening injuries.

"He was treated and stabilised on scene before being conveyed to Frenchay hospital with a critical care paramedic and critical care doctor on board."

Members of the community expressed their shock at what had happened and said they were praying for the victim.

Steph Wilkes, posting on Twitter, said: "Thoughts go out to the family and friends of the man who was shot in Devizes. Prayers are with you all."

The arrested man was in custody at Melksham police station on Monday evening. A number of roads close to the incident around Market Place in Devizes remained cordoned off.