Gov. Charlie Baker and Mayor Martin J. Walsh on Tuesday launched a new college affordability pilot program for Boston high school graduates, which will enable low-income students to complete a four-year degree without having to pay tuition and mandatory fees.

The new pilot program, known as The Boston Bridge that officials called historic, will be open to all 2017 high school graduates who live in the city of Boston, including students from Boston Public School, charters and parochial schools.

The city of Boston and the Commonwealth together will cover students’ tuition and fees, after taking into account federal Pell grants, from the time a student enters community college to when they graduate from a four-year public college or university.

“College affordability too often serves as a barrier for students in the Commonwealth seeking to complete a degree, and this program is intended to provide more opportunities for a quality education,” Baker said in a statement. “We are pleased to partner with the city of Boston on this important pilot and will keep pursuing ways, like the Commonwealth Commitment, to create a runway for all students to get a quality and affordable education that can unlock a bright future.”

While students attend community college, the city of Boston will cover the costs for tuition and mandatory fees, after taking into account Pell grants and discounts and credits from the Commonwealth Commitment program. Once a student earns an associate degree, they can transfer to a Massachusetts public college or university to complete their bachelor’s degree within two years. While they are enrolled in a public four-year institution, the city and the state together will cover the costs for tuition and mandatory fees, excluding room and board.

Allesandra Lanza, a spokeswoman for American Student Assistance, a Boston-based nonprofit dedicated to eliminating finance as a barrier to education, praised the move by the city and state.

“It’s never been more important to make higher education in Massachusetts more affordable and attainable," said Lanza in a statement. "A college-educated citizenry is the only way forward for our Commonwealth in the global and digital economy of the 21st century. Yet the explosion of student debt in recent years has left many questioning if college is worth it."