BOSTON -- Gov. Charlie Baker on Thursday signed a law to improve civics education in Massachusetts.

Schools will now be required to offer older students the chance to participate in a student-led civics project.

The Legislature passed the bill in July, but Baker sent it back with amendments to ensure that the civics being taught in schools remains nonpartisan. The Legislature passed a revised version of the bill in late October.

"Our administration is pleased to introduce new ways to strengthen civics education in the Commonwealth's public schools by signing this bill into law," Baker said in a statement. "We are grateful to our partners in the Legislature for their willingness to work with us on ensuring a non-partisan process for students to pursue civics related opportunities."

The law requires every school district that serves students in eighth grade or high school to offer all students the chance to participate in a non-partisan civics project, either individually or in a group. A student will be given the option of opting out of a group project to do a project individually.

State officials will develop a voter registration challenge, where students get their classmates to register or pre-register to vote. Although the voting age is 18, students can pre-register at 16 or 17.

The bill also lays out new requirements for civics education. Schools must teach about the state and U.S. constitutions, the Bill of Rights, local history and government, the branches of government, the responsibilities of a citizen in a democracy, digital media literacy, issues related to diversity and power, and etiquette regarding the flag.

A trust fund will be created to help school districts develop curricula that adhere to state history and civics education requirements.

Former Senate President Harriette Chandler, D-Worcester, who was a strong advocate for the bill, said in a statement, "Comprehensive civics education leads to more informed voters, better public policies, and a superior Commonwealth."