An edge in campaign spending wasn’t enough to save the D.C. Council members booted from office in the June Democratic primary, filings released this week show.

Voters in June ousted three council members allied with Mayor Muriel E. Bowser (D) and nominated former mayor Vincent C. Gray for his old council seat representing Ward 7. Filings due this week showed their campaign finance activity in the last days of the campaign.

Gray outraised his former protegee, council member Yvette M. Alexander (D-Ward 7) with about $194,000 in donations, while the incumbent slightly outspent him.

But in the crucial three months leading up to the election, Gray spent $131,000 to Alexander’s $89,000. Both labor unions and developers donated to the former mayor, banking on his return to public office.

Alexander exhausted almost all of the $179,000 she had raised, leaving her campaign $6,100 in debt. She did not respond to a request for comment.

In the other contested race east of the Anacostia River, council member LaRuby May (Ward 8) outspent her opponent nearly fivefold, with $221,000 in expenditures. She still lost to Trayon White by eight percentage points.

The race was a rematch of the narrowly decided special election in 2015 to fill the seat after Marion Barry’s death.

White, a former member of the Board of Education who legally changed his middle name to Ward Eight, ran a largely grass roots campaign with less than $50,000, the smallest of any major candidate in a contested race.

Council member Vincent B. Orange (D-At Large) also lost to political newcomer Robert White, but he has missed the Aug. 10 deadline to report his campaign finances.

Heading into the final days of the campaign, Orange had about twice as much remaining cash as White’s $49,000, according to June filings. Since then, White has raised an additional $158,000 — nearly as much as he raised during the primary campaign — with his victory in the general election almost assured.

Orange, who is resigning from council to take a job leading the D.C. Chamber of Commerce, did not respond to questions about why he hadn’t filed a campaign finance report.

The only incumbent in a contested race who emerged victorious, council member Brandon T. Todd (D-Ward 4), did so with a significant edge in campaign fundraising and spending.

Todd, who was chief fundraiser to Bowser’s mayoral bid and shares similar donors, raised $358,000 to his opponent Leon Andrews’s $201,000 haul. Most of Andrews’s money came from a $140,000 loan to himself, and he did not inject any of his own cash in the waning days of the race as he did in 2015.