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.