The racist Confederate symbol was added to the Mississippi flag in 1894.
Mississippi will retire the last state flag in the United States with the Confederate battle emblem, more than a century after white supremacist legislators adopted the design a generation after the South lost the Civil War.
A broad coalition of lawmakers — Black and white, Democrat and Republican — voted Sunday for change as the state faced increasing pressure amid nationwide protests against racial injustice.
Mississippi has a 38% Black population, and critics have said for generations that it's wrong to have a flag that prominently features an emblem many condemn as racist.
Democratic Sen. David Jordan told his colleagues just before the vote that Mississippi needs a flag that unifies rather than divides.
"Let's do this because it's the right thing to do," Jordan said.
The Senate voted 37-14 to retire the flag, hours after the House voted 91-23.
Cheers rang out in the state Capitol after the Senate vote. Some spectators wept. Legislators embraced each other, many hugging colleagues who were on the opposing side of an issue that has long divided the tradition-bound state.
Republican Gov. Tate Reeves is expected to sign the bill into law in the next few days.
Democratic Rep. Robert Johnson of Natchez choked back tears as he told reporters that he has seen white colleagues develop more empathy about how the Confederate symbol is painful to him and other African Americans.
"They began to understand and feel the same thing that I've been feeling for 61 years of my life," Johnson said.
A commission will design a new flag that cannot include the Confederate symbol and that must have the words "In God We Trust." Voters will be asked to approve the new design in the Nov. 3 election. If they reject it, the commission will set a different design using the same guidelines, and that would be sent to voters later.
Republican House Speaker Philip Gunn, who is white, has pushed for five years to change the flag, saying the Confederate symbol is offensive.
"How sweet it is to celebrate this on the Lord's day," Gunn said.
Legislators put the Confederate emblem on the upper left corner of Mississippi flag in 1894, as white people were squelching political power that African Americans had gained after the Civil War.
In a 2001 statewide election, voters chose to keep the flag. An increasing number of cities and all Mississippi's public universities have taken down the state flag in recent years. But until now, efforts to redesign the flag sputtered in the Republican-dominated Legislature.
That dynamic shifted as an extraordinary and diverse coalition of political, business, religious groups, and sports leaders pushed for change.
At a Black Lives Matter protest outside the Mississippi governor's mansion in early June, thousands cheered as an organizer said the state needs to divorce itself from all Confederate symbols.
Religious groups said erasing the rebel emblem from the state flag is a moral imperative. Notable among them was the state's largest church group, the 500,000-member Mississippi Baptist Convention, which called for change last week after not pushing for it before the 2001 election.
Business groups said the banner hinders economic development in one of the poorest states in the nation.
In a sports-crazy culture, the biggest blow might have happened when college sports leagues said Mississippi could lose postseason events if it continued flying the Confederate-themed flag. Nearly four dozen of Mississippi's university athletic directors and coaches came to the Capitol to lobby for change.
Many people who wanted to keep the emblem on the Mississippi flag said they see it as a symbol of heritage.
The battle emblem is a red field topped by a blue X with 13 white stars. The Ku Klux Klan and other hate groups have waved the rebel flag for decades.
The Mississippi Supreme Court found in 2000 that when the state updated its laws in 1906, portions dealing with the flag were not included. That meant the banner lacked official status. The Democratic governor in 2000, Ronnie Musgrove, appointed a commission to decide the flag's future. It held hearings across the state that grew ugly as people shouted at each other about the flag.
Legislators then opted not to set a flag design themselves, and put the issue on the 2001 statewide ballot.
Former Mississippi Gov. William Winter, who is now 97, served on then-President Bill Clinton's national advisory board on race in the 1990s and was chairman of the Mississippi flag commission in 2000. Winter said Sunday that removing the Confederate symbol from the banner is "long overdue."
"The battle for a better Mississippi does not end with the removal of the flag, and we should work in concert to make other positive changes in the interest of all of our people," said Winter, a Democrat who was governor from 1980 until 1984.
Democratic state Sen. Derrick Simmons of Greenville, who is African American, said the state deserves a flag to make all people proud.
"Today is a history-making day in the state of Mississippi," Simmons told colleagues. "Let's vote today for the Mississippi of tomorrow."