Come April, divers for ride service companies like Uber and Lyft will have to pass the strictest background check in the country, according to a deal reached between the Massachusetts legislature and the companies Monday.

The new rules would require the companies ensure that the independent drivers who provide taxi-like services pass state background checks, including their criminal records, and require that they not be registered sex offenders, state officials said.

RELATED: Uber driver charged with raping 16-year-old girl

"The safety and security of the riding public is our top priority, and I am pleased this agreement will set a national standard for the most comprehensive state background checks for TNC drivers in the country," said Governor Charlie Baker, using an acronym for "transportation network companies," the label Massachusetts uses to described Uber Technologies Inc, Lyft and similar companies.

The rules require that the companies begin the background checks for all drivers operating in the state by Jan. 6 and complete them by April 3. That is a year earlier than they would have been mandated by a state law on ride-sharing companies passed this summer.

Existing taxi companies have complained that the services, which allow riders to use smartphone apps to summon drivers, are able to undercut their prices because by they are not bound by strict local licensing and safety rules.

RELATED: Uber driver charged with sexually assaulting passenger

There have been several instances of sexual violence by Uber drivers in the Boston area, including a Dorchester man who was charged with raping a 16-year-old girl who he was hired to drive. Another Uber driver was charged with raping a woman he picked up in Boston.

These incidents aren't isolated to the Boston area, an Uber driver in Kalamazoo, Michigan, earlier this year was charged with killing six people in a shooting spree.

Representatives for the two companies could not be reached for immediate comment. Local media, however, reported that both said they supported the deal.