The Senate voted 84-15 to confirm Yellen, with all opposition coming from Republicans, several of whom have expressed concerns about President Joe Biden's $1.9 trillion coronavirus aid proposal, tax and spending plans.
The Senate later on Monday evening was expected to receive articles of impeachment against former President Donald Trump, a move that has also stoked some partisan divisions.
Senate Majority Leader Chuck Schumer said Yellen had made history for a second time, seven years after she became the first woman to chair the Federal Reserve.
"At the Treasury Department, there are long hallways where portraits hang of all 77 Treasury Secretaries — all men, all the way back to Alexander Hamilton," Schumer wrote on Twitter. "I'm thrilled to vote for Janet Yellen today and add the first portrait of a woman to that hallway."
Yellen will play a key role in working with Congress on Biden's coronavirus stimulus plans and on his pledges to invest $2 trillion in infrastructure, green energy projects, education and research to boost American competitiveness.
Treasury will oversee Biden's plans to help finance these initiatives by raising the corporate tax rate to 28% from 21% and increase taxes on those making over $400,000 a year.
Republicans have expressed concerns over the price tag and increased debt in a return to fiscal conservatism after running up deficits during Trump's term with the 2017 tax cuts and nearly $5 trillion in coronavirus spending.
Yellen told senators at her confirmation hearing last week that they needed to raise the minimum wage and "act big" on stimulus measures or risk a longer, more painful recession brought on by the pandemic.