WASHINGTON — President Obama on Tuesday rejected an attempt by lawmakers to force his hand on the Keystone XL oil pipeline, using his veto pen to sweep aside one of the first major challenges to his authority by the new Republican Congress.

With no fanfare and a 104-word letter to the Senate, Mr. Obama vetoed legislation to authorize construction of a 1,179-mile pipeline that would carry 800,000 barrels of heavy petroleum a day from the oil sands of Alberta to ports and refineries on the Gulf Coast.

In exercising the unique power of the Oval Office for only the third time since his election in 2008, Mr. Obama accused lawmakers of seeking to circumvent the administration’s approval process for the pipeline by cutting short “consideration of issues that could bear on our national interest.”

By rejecting the legislation, Mr. Obama retains the right to make a final judgment on the pipeline on his own timeline. But he did little to calm the political debate over Keystone, which has become a symbol of the continuing struggle between environmentalists and conservatives.