A witness has described seeing a police officer kneel down and try to comfort a man with a suspected gunshot wound near a police station south of Perth.

St John Ambulance was called to treat a man in his 30s near the Rockingham police station on Whitfield Street at 12:14pm.

WA Police said in a statement it was not yet known how the man became injured, or where he received the injury.

"Police officers provided first aid to the man, and St John Ambulance attended and took him to hospital," the statement said.

The wounds were to his chest area, with the injuries thought to be life threatening.

He was taken to Rockingham General Hospital but later transferred to Royal Perth Hospital, where he is in a stable condition.

A witness, who wanted to be known only as Geoff, said he heard a big bang.

"I thought it was a car backfiring. Immediately a car sped off and this guy has doubled over," he said.

"He said 'I've been shot, I've been shot'.

"I thought it was just a hoax to begin with.

"He was shot below the breast and he was in a bad, bad state. A policeman kneeled down with him and tried to comfort him.

"I went across to my car and got a cushion and took it back to the police guy who stuck it under his head."