Image copyright AP

A gunman who attacked downtown buildings and the Mexican Consulate in Austin, Texas, before being shot, may have had political reasons, say police.

The white, middle-aged man fired at the consulate, the police headquarters and a courthouse early on Friday morning.

He was shot by police but it is not clear whether he was fatally wounded or took his own life.

Police said it looked like an "anti-government" attack and pointed to the "heated" immigration debate.

When asked if it was a political attack on the government, Austin Police Chief Art Acevedo said: "If you look at the targets that were hit, it doesn't take a genius to figure out that that's a potential."

The political discourse around immigration, he added, "becomes very heated and very angry and sometimes the rhetoric is not healthy".

No-one was injured in the attack and a fire the man started at the consulate caused very little damage.

The man was unidentified but described as white and about 50 years old.

After being shot, officers noticed cylinders in his vehicle nearby and discovered he was wearing a vest they thought might be rigged to blow up.

A bomb squad was called but they determined that the items were not explosive.

President Barack Obama recently took action, bypassing Congress, to lift the threat of deportation for more than four million undocumented people living illegally in the US.

The man's home is now being searched.