The final vote was 62-37, short of the two-thirds needed to override the presidential veto. Supporters of the measure had previously said they lacked the votes.
While issuing his veto, Obama had said Congress was attempting to "circumvent longstanding and proven processes for determining whether or not building and operating a cross-border pipeline serves the national interest."
The U.S. State Department has been reviewing the pipeline for more than six years. Congressional Republicans want to short-circuit that process, which is still ongoing, and grant a permit immediately.
The pipeline, which would carry crude from Canada's tar sands to the Gulf of Mexico, is controversial. Its supporters include politicians from both parties, some unions and energy companies; environmental groups, some Nebraska landowners and some liberal Democrats oppose the project.
For more on the project, please go here.