Four people have been injured in a blast at a subway station in the heart of Manhattan, in what the mayor of New York said was an "attempted terrorist attack".

The blast, which took place in the station at the Port Authority bus terminal, sparked commuter panic and travel disruptions.

Police said a man suspected of being behind the blast was in custody and suffered injuries. He has been identified as Akayed Ullah.

Three other people, including a police officer, had minor injuries.

US media is reporting that the suspect told investigators that he was avenging attacks on the so-called Islamic State group and chose the location by its Christmas posters.

"This is New York. The reality is that we are a target by many who would like to make a statement against democracy, against freedom," New York Governor Andrew Cuomo told reporters.

"This was an attempted terrorist attack," Mayor Bill de Blasio added. "Thank god the perpetrator did not achieve his ultimate goals."

New York police commissioner James O'Neill said the 27-year-old suspect had strapped the explosive device to his body. He suffered burns to the hands and abdomen, and other injuries.

Photos circulated on social media of the man on the ground with his hands cuffed behind his back and injuries to his torso.

Police said he is from the Bangladeshi city of Chittagong and is also a US resident. He had no criminal record there and last visited Bangladesh in September.

Mr Cuomo said the attacker apparently used the internet to obtain information on how to make a bomb.

Fox News reported that the attacker made the device at his job at an electrical company and there were no known co-conspirators.

Police quickly evacuated the Port Authority station and closed roads in the area, which were filled with police cars and ambulances with flashing lights.

The blast occurred at the peak of the morning rush hour, shortly before 8am (1pm Irish time), when large numbers of people were headed to work.

Subway trains were bypassing the Port Authority and Times Square stations.

US President Donald Trump said the bomb attack highlights the "urgent need" for Congress to enact immigration reform legislation.

Mr Trump said in a statement the suspect had entered the United States on a family immigrant visa, benefiting from a US policy known as chain migration, which the president said "is incompatible with national security."

New York is on high alert ahead of the Christmas and New Year holidays and after the recent truck attack in lower Manhattan that killed eight people and injured 12.

The bus terminal is the busiest in the United States, according to the Port Authority. On a typical weekday, about 220,000 passengers arrive or depart on more than 7,000 buses.