President Joe Biden has signed legislation making Juneteenth, the day marking the end of slavery in the US, a federal holiday.

Biden held a signing ceremony at the White House on Thursday afternoon, after a bill designating June 19 a new federal holiday passed both the House of Representatives and the Senate with overwhelming bipartisan support.

“Great nations don’t ignore their most painful moments. They embrace them,” Biden said in remarks before the signing.

“Great nations don’t walk away,” he added. “We come to terms with the mistakes we’ve made, and remembering those moments, we begin to heal.”

Juneteenth, the first new federal holiday since the birthday of Martin Luther King Jr was designated in 1983, will bring the total to 11. Non-essential government offices are closed and federal employees are given paid days off on federal holidays, which are also often recognised by private employers.

Juneteenth, a portmanteau word from June 19, commemorates the date in 1865 when Union troops delivered news of freedom to slaves in Texas more than two months after the end of the US Civil War. President Abraham Lincoln had issued his Emancipation Proclamation, formally declaring slaves as free, more than two years earlier.

Commemorations originated in Texas but eventually spread to states around the US. The date was embraced by corporate America in the wake of the murder of George Floyd, a black man, by a Minneapolis police officer last year.

“With this step Congress is ensuring that one of the most momentous events in our history, particularly black Americans, for 150 years now is officially recognised and it is enshrined in our history books and it takes its place of honour in our nation,” Nancy Pelosi, the Speaker of the House, said on Wednesday ahead of a vote in the lower chamber of Congress.

The Juneteenth bill passed the Democrat-controlled House with a vote of 415-14 late on Wednesday after it was approved by the Senate using a procedure called unanimous consent, meaning no senator objected. It will become law when it is signed by the president.

The 14 House members who opposed the legislation were all Republicans, including representatives Mo Brooks of Alabama, Chip Roy of Texas and Thomas Massie of Kentucky.

The legislation comes at a time when lawmakers are still wrangling over federal police reform legislation first drafted shortly after Floyd’s murder in May 2020.

Biden had called on Congress to pass the George Floyd Justice in Policing Act ahead of the first anniversary of Floyd’s death. But lawmakers missed the deadline because of a protracted disagreement over qualified immunity, a legal principle that protects police from being held liable for actions they take on the job.

Tim Scott, the Republican senator from South Carolina, and Cory Booker, the Democratic senator from New Jersey — the only two black senators in their 100-member chamber — have led the negotiations and continue to insist that a deal can be done.