PORTLAND — The political polarization in Washington can be diminished, but only when Americans support candidates who follow the principles of consensus-building, U.S. Sen. Olympia Snowe told graduates during a commencement speech Saturday.

Snowe delivered what will likely be her final commencement address as a senator at the University of Southern Maine graduation ceremony.

Congress has an obligation to “set America on the right course,” and the public has a right to demand that government work on their behalf, Snowe said at the Cumberland County Civic Center.

“What it will require, however, is a commitment to solving problems rather than perpetuating political absolutes — the kind of absolutes so prevalent today that drive the political wedges that stand between us and our ability to achieve great things during this consequential moment in the life of our nation,” she said.

Snowe announced in February that she would not seek a fourth term in November’s election, citing frustration with what she called the political polarization in Washington politics.

On Saturday, she said the “sensible center” has been disappearing in Congress, “leaving us with a political era defined by all-or-nothing propositions that do everything to advance political agendas for the next election and nothing to advance the common good for the next generation.”

She said she would speak out on behalf of people committed to civility in government.

Elsewhere across Maine, commencements were held at other University of Maine campuses in Farmington, Augusta, Machias, Presque Isle and Fort Kent. The state’s flagship university, in Orono, held its graduation ceremonies last weekend.