In the statement issued just before 5 p.m., the president said Congress needs to end what he called "chain migration" and increase immigration security after police said Akayed Ullah -- a 27-year-old man of Bangladeshi descent with a last known address in Brooklyn -- detonated a crude explosive device in the tunnel between the Port Authority Bus Terminal and the Times Square/42nd Street subway station about 7:15 p.m. Monday.

"First and foremost, as I have been saying since I first announced my candidacy for President, America must fix its lax immigration system, which allows far too many dangerous, inadequately vetted people to access our country," Trump said in the statement.

U.S. Attorney General Jeff Sessions said Tuesday that an attack on the New York City subway system showed in the "starkest terms" that the failures of the U.S. immigration system are a national security issue.

Speaking at a news conference with the new chief of Homeland Security, Sessions said two terrorist attacks in New York in recent months were each carried out by men who were in the U.S. "as a result of failed immigration policies."

Ullah is not a U.S. citizen but had attained permanent residency. He came to the country on Feb. 21, 2011, on a F43 family immigrant visa. A Department of Homeland Security spokesman said he benefited from "family chain migration."

"Today’s terror suspect entered our country through extended-family chain migration, which is incompatible with national security," Trump said in the statement.

The president, who often takes to Twitter after terror attacks, has yet to tweet about Monday's explosion.

After Halloween's attack in Tribeca that left 8 people dead, the president likewise zeroed in on immigration, tweeting that he wanted to end the diversity visa lottery program that suspect Sayfullo Saipov used to enter the country.

Today’s attempted mass murder attack in New York City—the second terror attack in New York in the last two months—once again highlights the urgent need for Congress to enact legislative reforms to protect the American people.

First and foremost, as I have been saying since I first announced my candidacy for President, America must fix its lax immigration system, which allows far too many dangerous, inadequately vetted people to access our country. Today’s terror suspect entered our country through extended-family chain migration, which is incompatible with national security. My Executive action to restrict the entry of certain nationals from eight countries, which the Supreme Court recently allowed to take effect, is just one step forward in securing our immigration system. Congress must end chain migration. Congress must also act on my Administration’s other proposals to enhance domestic security, including increasing the number of Immigration and Customs Enforcement officers, enhancing the arrest and detention authorities for immigration officers, and ending fraud and abuse in our immigration system. The terrible harm that this flawed system inflicts on America’s security and economy has long been clear. I am determined to improve our immigration system to put our country and our people first.

Second, those convicted of engaging in acts of terror deserve the strongest penalty allowed by law, including the death penalty in appropriate cases. America should always stand firm against terrorism and extremism, ensuring that our great institutions can address all evil acts of terror.