House Speaker Paul D. Ryan (R-Wis.) in the Oval Office. (Evan Vucci/AP)

Congressional negotiators reached an agreement late Sunday on a broad spending package to fund the government through the end of September, alleviating fears of a government shutdown later this week, several congressional aides said.

Congress is expected to vote on the roughly $1 trillion package early this week. The bipartisan agreement includes policy victories for Democrats, whose votes will be necessary to pass the measure in the Senate, as well as $12.5 billion in new military spending and $1.5 billion more for border security requested by Republican leaders in Congress.

The agreement follows weeks of tense negotiations between Democrats and GOP leaders after President Trump insisted that the deal include funding to begin building a wall along the U.S.-Mexico border. Trump eventually dropped that demand, leaving Congress to resolve lingering issues over several unrelated policy measures.

The new border-security money comes with strict limitations that the Trump administration use it only for technology investments and repairs to existing fencing and infrastructure, the aides said.

“This agreement is a good agreement for the American people and takes the threat of a government shutdown off the table,” said Senate Minority Leader Charles E. Schumer (D-N.Y.). “The bill ensures taxpayer dollars aren’t used to fund an ineffective border wall, excludes poison pill riders and increases investments in programs that the middle class relies on, like medical research, education and infrastructure.”

Schumer and House Minority Leader…