Chicago's beleaguered former red-light camera vendor, still reeling from a $2 million bribery scandal that nearly brought down the international business, has agreed to pay $20 million to the city to settle its lawsuit over the company's admitted fraud.

According to a 12-page settlement agreement, Redflex Traffic Systems Inc. agreed to pay the city in mostly annual installments through 2023. The first installment of $5 million is due within 45 days, according to the agreement.

Michael Finn, Redflex's president and CEO, said in a prepared statement he hopes the agreement marks the end of the company's struggles in the U.S. stemming from the Chicago scandal. Redflex is still under investigation by federal authorities in Australia, home to the company's publicly traded parent company, Redflex Holdings.

"Today marks a new beginning for Redflex," Finn said. "Over the last four years, we took the actions every responsible company would have chosen and enhanced our compliance management, training and oversight functions. ... Thanks to our resilient and remarkable employees, we are well-positioned for this new day."

Since first bringing red-light cameras to Chicago in 2003, Redflex earned more than $120 million from the city contract, installing 384 cameras and collecting more than $400 million in traffic fines.

That all came to an end beginning in 2012 when the Chicago Tribune first revealed allegations that the entire contract was built on a massive bribery scheme at City Hall. The Tribune went on to expose the mismanagement, failed oversight and dubious safety record of the city's red-light camera program as well.

Last year, John Bills, the City Hall manager who oversaw the contract for a decade, was sentenced to 10 years in federal prison for taking up to $2,000 for every camera installed, in addition to lavish vacation trips, an Arizona condominium, a Mercedes and other perks to curry his favor. Karen Finley, the former CEO of the company, and Martin O'Malley, the Redflex consultant who acted as the "bagman," were sentenced to shorter federal prison terms in return for their testimony at Bills' trial.

Following the Tribune disclosures, Mayor Rahm Emanuel fired Redflex and replaced it with another vendor. The company dismissed its top six executives, and the scandal resulted in authorities launching probes of Redflex contracts in other cities around the country.

Chicago's red light camera system grew to more than 350 cameras and has raised more than $500 million in $100 tickets since 2002. Tribune investigations beginning in 2012 have exposed corruption, failed oversight and inconsistent enforcement in the program.

The Emanuel administration first sued the company in 2015 for up to $360 million in damages — three times the amount the company earned from the fraudulent contract — alleging breach of contract, civil conspiracy, unjust enrichment and payment of kickbacks in connection with city contracts.

At the time, Emanuel said he wanted every company doing business or hoping to do business with the city to know he will not stand idly by when taxpayers are defrauded.

The city's lawsuit against Redflex alleged that Bills' actions corrupted the competitive bidding process and defrauded Chicago taxpayers. It detailed how in exchange for the hundreds of thousands of dollars in bribes and other perks, Bills coached Redflex on how to beat its competitors, orchestrated key votes at City Hall, manipulated field tests to favor the company and covered up problems with Redflex's performance.

Bills helped the firm build its Chicago business into the largest automated traffic enforcement program in the country.

At Bills' trial, his attorney, Nishay Sanan, had tried to portray Bills as a fall guy but provided scant evidence as he tried to blame the scheme on such political luminaries as House Speaker Michael Madigan and former Mayor Richard Daley. Bills, though, refused to cooperate with federal prosecutors looking to expand their investigation.

"The city of Chicago is going to do whatever it has to do to show they had nothing to do with anything, but we all know that's not the case," Sanan said at the time the city filed its lawsuit against Redflex in 2015. "It was about revenue for them."

The city expects to receive $10 million of the settlement during the current budget year but hasn't yet determined how the money will be spent, spokesman Molly Poppe said.

Since uncovering the bribery scheme, the Tribune exposed a series of additional problems with the red-light camera program, including unfair enforcement practices that tagged thousands of drivers during unexplained ticket surges at malfunctioning red-light cameras.

In response, the city's inspector general's office reported that both the Daley and Emanuel administrations could not document how or where they chose to place cameras. The inspector general's office also found that the administrations abdicated their responsibility to ensure the camera system was working properly and instead focused on keeping the cameras rolling — and the ticket revenue pouring in.

Emanuel shut down dozens of cameras amid his re-election bid, promised to improve oversight, played down the significance of the findings and sought to refocus public attention on safety benefits.

After the Tribune series, the city offered to review the tickets of some drivers caught in unexplained ticket spikes. Ultimately, though, fewer than 200 tickets were refunded.

The Tribune also commissioned a traffic study that showed that nearly half the city's cameras installed under Bills' watch were placed at intersections that never had many crashes in the first place. In addition the study found that rear-end collisions at those intersections rocketed 22 percent because of the cameras.

The Tribune investigation of the traffic camera programs also revealed how the Emanuel administration ordered the new camera vendor to issue tickets even when yellow light times dipped below the three-second minimum requirement, how Emanuel's new speed camera program has tagged drivers in school zones without the legally required evidence of a child present, and how many of the most lucrative speed cameras were placed on major thoroughfares where few pedestrians are hit by speeding cars.

All told, the controversial automated traffic enforcement programs have raised more than $600 million in fines.

Redflex has come under scrutiny throughout the country, leading to convictions in Ohio as well as Chicago. Redflex Holdings, once traded at nearly $4 per share on the Australian Securities Exchange, hit a low of 21 cents this year. It was trading at 55 cents per share Monday.

In its statement Monday, Redflex said it remains financially strong in spite of the $20 million settlement, citing its more than "150 existing contracts in communities across the Americas."