WASHINGTON — President Obama weighed in for the first time yesterday on the proposed Keystone XL pipeline from Canada to Texas, saying it should be approved only if it won’t increase carbon pollution.

The $7 billion pipeline has become a contentious issue, with Republicans touting the jobs it would create, and environmentalists urging the administration to reject it, citing the oil it would carry from Canadian tar sands to the Texas Gulf Coast.

“Allowing the Keystone pipeline to be built requires a finding that doing so would be in our nation’s interests,” Obama said in a speech on climate change at Georgetown University.

“Our national interest would be served only if this project does not significantly exacerbate the problem of carbon pollution.”

Obama made it clear he was instructing the State Department to approve the pipeline only if emissions of greenhouse gases are kept in check.

A State Department report earlier this year acknowledged that development of tar sands in Alberta would create greenhouse gases, but also further made clear that other methods of transporting the oil — including rail, trucks and barges — pose risks to the environment, too.

A top aide to House Speaker John Boehner (R-Ohio) said the president’s remarks indicated that the pipeline should be approved.

“The standard the president set today should lead to speedy approval of the Keystone pipeline,” Boehner spokesman Brendan Buck said.