Many top Republicans have denounced President Obama’s unilateral move, which is intended to spare as many as five million people living illegally in the United States from deportation.

But the Texas attorney general, Greg Abbott, went a step further by filing a lawsuit in federal court in the Southern District of Texas.

Texas was joined by 16 states, mostly in the South and Midwest, including Alabama, Georgia, Idaho and Indiana. In the suit, Mr. Abbott, who will become governor in January, argued that Texas could be uniquely hurt by the executive orders because of its long border.