Over 100 cars were set ablaze inside the parking garage of the Kings Plaza mall.

A federal judge on Wednesday gave a five-year sentence to a man who set a massive fire in a parking garage at a Brooklyn mall last year — because he believed people were having sex inside the cars.

Evon Stephens, 24, was also sentenced to three years of supervised release after he pleaded guilty to setting the Sept. 17, 2018, blaze at the Kings Plaza Shopping Center, which damaged 135 vehicles owned by Mercedes-Benz and led to more than 20 people being treated for smoke inhalation.

But Brooklyn federal Judge I. Leo Glasser balked at prosecutors’ insistence that Stephens, who is represented by a public defender, pay $7.1 million in restitution — saying that expecting him to come up with that cash is “clearly silly, to put it mildly.”

Glasser gave the lawyers another two weeks to pore over restitution statutes to determine if the payment should be mandatory for Stephens.

According to court papers, at about 8 a.m on the day of the fire, surveillance cameras captured Stephens entering the parking garage before the Marine Park shopping center was open and heading over to a portion of the garage used by a Mercedes-Benz dealership.

Stephens is seen climbing into a parked vehicle and, within five minutes, smoke and fire are coming from that vehicle and Stephens is seen fleeing from the parking garage on foot.

Stephens was arrested at about 3:30 p.m. near the lot. During an interview with police, he blurted out that he purposefully set the fire at the dealership because he believed that people “used the parked vehicles for sexual activity,” according to his criminal complaint.

“I just want to apologize to the people who work at the mall, the people who go to the mall and the community, because I ruined a nice place,” Stephens said Wednesday during his sentencing.