Congress has reached an agreement on a transportation bill for the first time since 2005, averting a crisis that could have disrupted the nation’s highway projects at the height of the construction season.

In the final days before a deadline, Republicans dropped their demands to piggyback onto the bill approval for the Keystone oil pipeline, as well as relaxation of proposed restrictions on coal ash produced by power plants.

In return, Democrats gave up on $1.4 billion for conservation and agreed to allow states more leeway in how they use money that was once mandated for landscaping, bike improvements and pedestrian walkways.

“I am so glad that House Republicans met Democrats halfway, as Senate Republicans did months ago,” said Sen. Barbara Boxer (D-Calif.), the bill’s chief architect and advocate. “The bill is funded at current levels, and it will protect and create 3 million jobs.”

The conference committee bill, which would maintain spending at the current level of about $54 billion a year, is set to come up for a ratification vote in both chambers this week.

“This is the jobs bill for the 112th Congress,” said House transportation committee Chairman John L. Mica (R-Fla.). “This agreement will help strengthen our nation’s construction industry and provide stability to highway, bridge and infrastructure projects across the country.”

The deal was struck in the shadow of a June 30 deadline, when federal highway funding was due to expire. It came after House Speaker John A. Boehner (R-Ohio) and Senate Majority Leader Harry M. Reid (D-Nev.) ordered conference committee members back to the table after talks appeared to falter last week.

While the details will take several days to emerge, the bill would streamline a federal system that expanded its network of agencies and programs in a patchwork fashion to meet immediate needs, producing a cumbersome bureaucracy that has smothered state transportation projects.

“We speed up project delivery, cut red tape and do it without jeopardizing environmental laws,” Boxer said. “For the first time, we send half of the funds for bike paths and pedestrian walkways directly to local entities, and we protect those funds while giving states more flexibility on their share.”

The bill also would provide greater incentives for corporations to partner with government to invest in major infrastructure improvements.

The agreement is a notable achievement for lawmakers, who have garnered public disdain for their inability to agree on much. But even long before partisan politics came to infuse every issue, Congress had proved itself unable to resolve the nation’s transportation needs.

It last approved a long-term plan in 2005 and has extended funding at that level nine times since the measure expired almost three years ago. Democrats controlled both the House and the Senate during the first several extensions.

No one pretends that the new bill would provide a sound long-term footing for the national transportation system. It would expire in 2014, and it would draw on several other pools of money to supplement the longtime source of federal transportation funding, the Highway Trust Fund.

In a sharp critique this month, Taxpayers for Common Sense concluded: “The story remains a familiar one: Congress wants to spend more money than it has.”

The transportation bill would rely on transfers of almost $5 billion from the general fund; almost $3.7 billion from a fund to fix leaking underground storage tanks; almost $700 million from the gas guzzler tax, which targets new cars with poor fuel economy; and $4.5 billion from tariffs on imported vehicles.

“The Highway Trust Fund is going bankrupt, and this paid-for measure provides necessary, real reform that focuses our limited resources on critical infrastructure needs,” Mica said.

The federal gas tax — set at 18.4 cents per gallon — funded the interstate system and contributes almost $40 billion toward current highway and transit projects. But that revenue has been bolstered in recent years by $34.5 billion from general tax funds, a practice that distressed lawmakers and transportation planners who prefer the comfort of a dedicated source of money.

The gas tax was last increased in 1993, and Congress has had little interest in raising it. (Inflation has eroded the value of that 1993 tax to 11 cents.) Neither have lawmakers shown much inclination to implement a taxing system that charges drivers for the miles they travel through some sort of toll.

If Congress continues transportation spending at current levels through 2021, the Highway Trust Fund will fall between $85 billion and $115 billion short. And even if lawmakers find a new way of funding transportation to fill that gap, the spending will be far less than what is required to meet infrastructure needs.

A group co-chaired by former transportation secretaries Samuel K. Skinner and Norman Y. Mineta has estimated that an additional $134 billion to $262 billion must be spent per year through 2035 to rebuild and improve roads, rail systems and air transportation.

The American Society of Civil Engineers has projected that $1.7 trillion should be invested between now and 2020 to rebuild roads, bridges, water lines, sewage systems and dams that are reaching the end of their planned life cycles.

The debate over programs for bikes, pedestrians and landscaping — known as enhancements — was a flash point, with each side believing that it was taking the more pragmatic and realistic approach. Cyclists and pedestrians argued that investment in riding and walking saves fuel, reduces pollution, promotes health and relieves congestion.

Opponents of the programs, largely Republicans, didn’t debate any of that but said the initiatives were a luxury in tight times when roadway repair should be given a higher priority, and they thought that states should be allowed leeway in setting spending priorities.

A deal reached among Senate leaders to freeze student-loan rates for a year will probably be packaged with the transportation measure, speeding passage through both chambers before the end of the week.