BOSTON (AP) — The Massachusetts House and Senate have unanimously passed a compromise bill aimed at overhauling the state’s public records law, bringing the measure one step closer to Republican Gov. Charlie Baker’s desk.

The bill approved Wednesday would require public records requests to be completed in 10 days. If an agency or municipality cannot comply, the person in charge of producing the records must explain the reasons for the delay. A one-time extension could be granted.

The bill also would limit how much an agency or municipality could charge to provide the records.

The bill is a compromise version of separate bills previously approved by both chambers.

“Today the Senate voted for an enforceable public records law which will increase transparency and affordability, and get much faster results,” said Senate President Stanley C. Rosenberg, D-Amherst. “When this bill becomes the law, it will bring us to an era of greater transparency, more civic engagement, and better governance.”

Open records advocates say the bill is long overdue.

“A strong public records law is critical to democracy and our ability as citizens to hold government accountable,” said Pam Wilmot, executive director of Common Cause Massachusetts. “With today’s vote, the House and the Senate made a significant commitment to transparency and freedom of information, improving open government, and moving our state a huge step forward from near last in the nation. This reform is long overdue and we hope the governor will sign it without delay.”

The bill now heads to Baker, who has 10 days to sign or veto the legislation.