WASHINGTON—After weeks of partisan wrangling, President Barack Obama and congressional leaders reached a deal Sunday night to raise the government's debt ceiling while cutting spending by about $2.4 trillion, avoiding a government default but setting the stage for months more of stormy debates over how Washington taxes and spends.

The Senate and House are expected to vote on the deal Monday, so the agreement still needs the support of many House Republicans, who have proven...