The House voted Friday to approve the Keystone XL pipeline shortly after the Nebraska Supreme Court handed down a ruling in favor of building the controversial Canada-to-Texas pipeline.

The House passed the bill to authorize construction of the pipeline in a 266-153 vote that included 28 Democrats and 238 Republicans. Now it's up to the Senate to approve the bill before it can be presented to President Barack Obama.

However, the president doubled down on his promise to veto the bill if it eventually gets to his desk. He also dismissed the Nebraska ruling, which tossed out a lawsuit challenging the pipeline's route.

"Regardless of the Nebraska ruling today, the House bill still conflicts with longstanding executive branch procedures regarding the authority of the president and prevents the thorough consideration of complex issues that could bear on U.S. national interests, and if presented to the president, he will veto the bill," said deputy press secretary Eric Schultz on Friday, according to the Associated Press.

In response, Republicans slammed the president for opposing the bill.

"We shouldn't be debating it, we should be building it," said House Majority Leader Kevin McCarthy of California.

Senate Majority Leader Mitch McConnell also blasted the president following the court's decision.

"Today's ruling provides the perfect opportunity for the president to change his unproductive posture on this jobs project and reverse his veto threat," McConnell said. "The president now has every reason to sign it."

The approval of the pipeline was one of the first pieces of legislation considered by the new 114th Congress, which is controlled by the GOP.

Environmentalists say that the pipeline would bring heavy tar sands oil from Canada across the middle of the United Sates to a port on the Gulf of Mexico. In turn, this will contribute to climate change and pollute the environment, reports MSNBC.

Republicans, however, argue that the pipeline will create jobs and reduce gas prices.

Still, Obama said at his year-end news conference that the benefits Republicans claim the pipeline will bring are inflated, and it would only increase temporary jobs for American workers.