Gray accepts the endorsement of the SEIU Maryland/D.C. State Council in its downtown offices Monday. (Mike DeBonis/The Washington Post)

Mayor Vincent C. Gray is seeking to bounce back from two straight second-place finishes in a Democratic primary straw polls by highlighting a pair of major labor endorsements.

The D.C./Maryland Council of the Service Employees International Union gave Gray its nod Monday, citing, among other things, his move to hire unionized security officers in city facilities and his support for granting driver’s licenses to illegal immigrants. The SEIU endorsement comes less than a week after District Council 20 of the American Federation of State, County and Municipal Employees, one of the biggest unions representing city workers, gave Gray their widely expected endorsement on Thursday.

“These are folks that we have to rely upon to get the work of our city done every day, inside of government and outside of government,” Gray said after accepting the SEIU endorsement in the union’s downtown offices. “I wanted to re-establish a positive relationship. … That’s what we’re doing, and that’s what we’re celebrating here today.”

Jaime Contreras, the council’s president, hailed Gray — even though the union failed in pushing Gray to support a more aggressive approach to the driver’s license legislation, one that would have made no distinction between the licenses held by immigrants and those held by everyone else.

“That’s what we would have preferred to have, but the reality is that would have been a lot more complicated … so we supported the bill that came through,” he said. “The people who right now who don’t have a license are going to be better off.”

Contreras said other factors played into the endorsement, too: “Our members did the interviews … and they felt the mayor had the best chance of winning this election.”

It won’t hurt that Gray will have SEIU in his corner, with 20,000 members living or working in the District and many of them willing to knock on doors or pick up phones on Gray’s behalf. Four years ago, SEIU made no mayoral endorsement. After accepting the endorsement,the mayor led a small crowd in a chant of “four more years,” waving four fingers in each hand.

“Actually that’s eight, isn’t it?” he said with a chuckle.