WASHINGTON—President Donald Trump urged lawmakers on Tuesday to pass broad immigration legislation by March as he said he would end a program that shields undocumented immigrants who entered the U.S. as children.

The move ignited an emotional battle in Congress and, in particular, among Republicans, who are divided over the five-year-old program. Congressional leaders in both parties promised to protect these young people from deportation, but the path to achieve that goal was unclear. Under the GOP president’s order, some...