A Brooklyn lawmaker who lost his Democratic primary has spent more than $3,700 in campaign cash on lease payments for a brand-new, Mercedes-Benz sedan — a car that he recently used for a workday booze run, The Post has learned.

State Sen. Jesse Hamilton (D-Crown Heights) — whose name remains on minor party lines in Tuesday’s ballot — leased the black 2018 model E300, which has a tan leather interior and alloy rims, on June 1 from Mercedes-Benz of Brooklyn, records show.

Hamilton used $1,687.50 in political contributions to cover two-thirds of the initial payment and also tapped his campaign war chest four more times, spending $509 on two-thirds of the monthly payments each time, according to disclosure forms filed with the state Board of Elections.

One payment was even made on Oct. 1, more than two weeks after Hamilton lost the Sept. 13 Democratic primary to challenger Zellnor Myrie.

Under state law, political candidates are barred from spending contributions to buy or lease vehicles unless they’re “used for campaign purposes or in connection with the execution of the duties of public office or party position.”

Last week, The Post found the pricey ride parked near Hamilton’s house with a state Senate “OFFICIAL BUSINESS” placard displayed on the dash.

On Tuesday, nobody bothered moving the luxury four-door to comply with alternate-side-of-the-street parking rules, like everyone else whose vehicle was parked on the block.

But Hamilton took it out for a spin on Wednesday — and bought several mini-bottles of liquor at a store on Pitkin Avenue in Brownsville, about two miles away.

Surveillance video shot inside Victor’s Wine & Liquor shows Hamilton pointing to a selection inside a case near the register around 3 p.m.

A copy of his receipt also shows he paid $15.50 in cash for an assortment of 10 nips of Bailey’s Irish Cream Vanilla Cinnamon and two flavors of Ciroc vodka — French Vanilla and Summer Colada.

When he returned home with the haul, Hamilton ignored repeated requests for comment while fumbling with his house keys.

But about a minute later, the fuming pol stormed back out and grabbed a Post reporter from behind.

“What’d you say to me?” Hamilton repeatedly yelled as he shoved the journalist and tried to snatch a cell phone out of his hand.

Hamilton then retreated back inside, snarling “Get off my property!” — even though the scribe was standing on the sidewalk.

Hamilton was formerly part of the eight-member Independent Democratic Caucus — which sided with Republicans to control the state Senate — and is among six who were defeated by more progressive Democratic primary challengers.

He still has two minor-party lines on Tuesday’s general election ballot, but essentially conceded the race in a series of post-primary statements on Twitter that touted his accomplishments and thanked his supporters.

Hamilton’s donor-fueled splurge on his Mercedes began during a six-month reporting period that started with $119,603 in his campaign coffers and ended in July with $212,476.

His latest filing, covering the three weeks that ended Oct. 23, showed he still had $27,271 on hand.

Legal experts said Hamilton’s automotive spending likely stayed within the guardrails of New York’s notoriously loophole-ridden election law.

“He’s still got a campaign going and he’s still in office,” said veteran election lawyer Marty Connor, himself a former state senator from Brooklyn.

“Technically he’s probably OK. But it’s stupid. What does he do in January when he’s out of office?”

Connor, who laughed out loud when told how Hamilton was paying for the high-end auto, also said that “the optics are horrible.”

“Is there any wonder he lost?” he asked.

Additional reporting by Carl Campanile