President-elect Joe Biden formally announced on Friday that Boston Mayor Marty Walsh is his pick for labor secretary.

In his announcement, Biden referred to Walsh as a "good friend and a stand-up guy" who is "tough as nails." Biden cited Walsh's experience as a union president and said the Boston mayor has "always put working people first — fighting for $15 minimum wage, paid family leave, providing frontline workers with emergency child care and protective equipment they need," Biden said. "Marty understands, like I do, the middle class built this country, and unions built the middle class."

Biden said he seriously considered nominating Vermont Sen. Bernie Sanders to head the Labor Department, but with a tied Senate they couldn't take the chance of losing a special election.

"He agreed we couldn't take that chance," Biden said of Sanders. "We also discussed how we'd work together, travel the country together, helping Marty, meeting with working men and women who feel forgotten left behind in this economy."

In accepting the nomination, Walsh spoke of his parents' emigration from Ireland and credited his father's membership in the laborers' union with allowing him to be raised in Dorchester with "dignity and security."

"I followed my father into that union," Walsh said. "I learned what it took to turn an honest day's work into an honest day's pay. I saw what fighting for good jobs, good benefits, a safe workplace does for the lives of hard-working men and women and their families. And I fought for working people every single day of my life since then."

Walsh said first responders, grocery store workers, sanitation workers and other working people have been "holding the country together" under impossible conditions during the COVID-19 pandemic. But he said their challenges aren't new.

"Working people have been struggling for a long time under the erosion of their rights, and the deep inequalities of race, gender and class," Walsh said. "For the last four years, they've been under assault — attacks on their rights, their livelihoods and the unions that built the middle class. We are facing hard times, but nobody's tougher than the American worker. And now we have the opportunity to put power back in the hands of working people all across this country."

Walsh also outlined some of his priorities in his new job.

"We can defend workers' rights, we can strengthen collective bargaining, we can grow union membership, we can create millions of good paying jobs with investments in infrastructure, clean energy and in high-tech manufacturing, along with the workforce training to help get those people into those good jobs."

Walsh's nomination was celebrated by some labor organizations in Massachusetts, including the state AFL-CIO, the Greater Boston Building Trades Unions and the Coalition for Occupational Safety and Health.

"When he arrives at the Department of Labor, Secretary Walsh will fight hard to reverse the destructive, anti-worker policies enacted over the past four years, providing further evidence of Joe Biden’s promise of being the 'strongest labor president' in American history," Massachusetts AFL-CIO President Steven A. Tolman said in a statement. "We know that Marty Walsh will bring his unique experience and skillset to the Dept. of Labor and will lead the charge for a brighter tomorrow for all Americans across the United States."