House Republicans clashed with the Obama administration over its recent executive actions on immigration Tuesday, with lawmakers blasting the measures as divisive and illegal but a top administration official defending them as a lawful and necessary first step toward fixing the nation's broken immigration system.

Homeland Security Secretary Jeh Johnson, in the first appearance on Capitol Hill by an administration official to defend Obama’s actions, said the administration ordered a thorough legal review to ensure their legality. “The reality is that, for decades, presidents have used executive authority to enhance immigration policy,’’ Johnson told the House homeland security committee.

Obama late last month announced a program to provide administrative relief and work permits to as many as 3.7 million undocumented parents of U.S. citizens and legal permanent residents, along with 300,000 young immigrants who were brought to the country illegally as children. The actions, which only defer deportations and do not provide legal status or a pathway to citizenship, came as the president has been attacked over immigration in recent months by all sides of the political spectrum.

GOP leaders have been considering various ways to stop the new program, and even as they spoke to Johnson in respectful tones at the hearing, they attacked the policies that he was there to defend.

“The president’s unilateral actions to bypass Congress undermine the constitution and threaten our democracy,’’ committee chairman Rep. Michael McCaul (R-Texas) said at the start of the hearing. “Regardless of where you stand on this issue, there is a right way to do this, and there is a wrong way. And unfortunately, the president has taken the wrong way.’’

Johnson responded that Obama’s actions were lawful and resulted from an extensive internal review in which the DHS chief consulted leaders of immigration agencies inside DHS, along with business and labor leaders and members of Congress.

“I recommended to the president each of the Homeland Security reforms to the immigration system that he has decided to pursue,’’ said Johnson, who acknowledged that the measures are imperfect. The president, he said, “continues to count on Congress for the more comprehensive reform that only changes in law can provide.’’

Democrats on the committee supported Johnson and criticized Republicans for what they called excessive criticism of Obama’s actions, especially when the GOP is unwilling to pursue broader immigration reform. Comprehensive reform is dead, for now, in Congress.

“I am troubled by the extreme criticism and disdain that this temporary and limited set of actions has received by some in Congress,’’ said Rep. Bennie G. Thompson (D-Miss.), the committee’s ranking member. He said Obama’s actions “are not outside the bounds of presidential authority, as provided under our Constitution.’’