PORTLAND, Maine — Jon Hinck, a former three-term state representative who last year unsuccessfully sought the Democratic nomination for the U.S. Senate, was elected on Tuesday to the Portland City Council in its most closely contested race.

In the two other council races, incumbent councilors Jill Duson and Ed Suslovic were re-elected by wide margins against candidates who had never previously sought public office.

Hinck received 7,101 votes, or 58 percent of those cast, for an at-large seat being vacated by Councilor John Anton, according to unofficial results late Tuesday night. Wells Lyons, who last year failed in a bid for an at-large seat held by Councilor Nicholas Mavodones, received 5,171 votes.

Hinck, 59, of Pine Street, is a lawyer who co-founded Greenpeace USA and has worked for the Natural Resources Council of Maine. He and Lyons, both Democrats, admitted that their political views were similar. Both supported efforts to make the city more sustainable, to strengthen public schools, and to improve city services such as trash collection.

But Hinck’s campaign stressed the value of pragmatism and experience he said he gained in the Legislature and other roles.

On Tuesday night, Hinck said the race had been a close one.

“I think it could have gone either way. My feeling when we started out was that we were pretty close,” he said. “I may have out-worked Wells. (He) was very good candidate, and most of the people I know who voted for me also liked him.”

Duson retained her at-large seat with 6,081 votes, or 47 percent of those cast. Challengers Christopher Shorr and Gregory Smaha received 3,178 votes and 3,657 votes, respectively.

Duson, 59, of Pennell Avenue, has served on the council since 2001 and is vice chairwoman of its Legislative Committee. A lawyer, she works as a compliance manager for the Maine Human Rights Commission and also as a clerk at the L.L. Bean retail store in Freeport.

A Democrat who was active as a teenager in the civil rights movement, Duson ran on a platform supporting education, sustainability and affordable housing.

Shorr, a Green Independent candidate, said his primary concern was homelessness and the needs of marginalized residents. In contrast, Smaha hoped to bring a business-savvy, fiscally conservative perspective to the council.

Flanking the more centrist Duson, the two challengers earned a combined 53 percent of the vote.

“They both had a strong showing. I’m not sure how to read that. But still, this is a clear victory,” Duson said Tuesday. “You can’t convince everyone to love you, and after all, it was a three-way race.

“(Shorr and Smaha) got out there, they really worked, and I hope this won’t be the last time the city sees them. I hope they will each stay engaged.”

In the District 3 council race, Suslovic defeated challenger Gregory Blouin with about 69 percent of the vote, 1,912 to 847. District 3 includes the neighborhoods of Rosemont, Deering Center, Libbytown and Nasons Corner.

Suslovic, 53, of Kenwood Street, is a community development consultant who held an at-large seat before winning election in 2010 in District 3. He also previously served a term as a state representative. But Tuesday’s vote was the first in which he has won re-election.

As chairman of the council’s Public Safety, Health and Human Services Committee, Suslovic has been at the center of several much-debated issues, including fire department staffing, restrictions on street artists, and the city’s recent ban on loitering in street medians.

Watching the election results being compiled in City Hall, Suslovic said they “put a nice exclamation mark on a term of serving the voters” and that he looked forward to continuing his work on current projects and other priorities ahead. And like Duson, he applauded his opponent, who ran perhaps the least visible of this year’s seven council campaigns.

“Democracy doesn’t work unless you have candidates to choose from,” Suslovic said.

An unofficial total of 17,875 people cast ballots Tuesday, or about 35 percent of the city’s 51,267 registered voters. The last off-year election, in November 2011, drew 20,242 voters.