Washington CNN  — 

Congress passed compromise legislation this week on gun safety that is now waiting to be signed into law by President Joe Biden.

The compromise legislation on gun safety was unveiled on Tuesday, and is potentially the most significant new federal gun safety measure in decades. It includes money for school safety, mental health, state crisis intervention programs and incentives for states to include juvenile records in the National Instant Criminal Background Check System, which would provide a more comprehensive background check for those between the ages of 18 and 21 who want to buy guns.

The legislation was finalized after days of haggling by lawmakers over several sticking points that had raised questions over whether the negotiations would fall apart.

Earlier this month, a bipartisan group of senators had released an agreement in principle for a deal on bipartisan gun legislation, which notably had the backing of 10 Republican senators. At least 10 Republican senators will need to join Democrats in supporting the bill for it to overcome a filibuster and pass in the Senate.

Here is a breakdown of what’s in the bill.

$750 million to help states implement and run crisis intervention programs

This money can be used to implement and manage red flag programs, which are aimed at keeping guns out of the hands of those who pose a threat to themselves or others. It also can be used for other crisis intervention programs like mental health courts, drug courts and veteran courts.

Whether the money could be used for things other than red flag laws was a primary sticking point at the end of the negotiations, and Republicans were able to secure money for states that don’t have red flag laws but have other crisis intervention programs.

Closing the so-called boyfriend loophole

This legislation closes a years-old loophole in domestic violence law that barred individuals who had been convicted of domestic violence crimes against spouses, or partners with whom they shared children or cohabitated with, from having guns. Old statutes didn’t include intimate partners who may not live together, be married or share children. The new bill would bar anyone who is convicted of a domestic violence crime against someone they have a “continuing serious relationship of a romantic or intimate nature” with from having a gun. The provision isn’t retroactive.

The bill, however, would allow those convicted of misdemeanor domestic violence crimes to restore their gun rights after five years if they haven’t committed other crimes.

Requires more gun sellers to register as Federally Licensed Firearm Dealers

The bill goes after individuals who sell guns as primary sources of income but have previously evaded registering as Federally Licensed Firearm Dealers. This is significant because federally licensed dealers are required to administer background checks before they sell a gun to someone.

More thorough reviews of people ages 18-21 who want to buy guns

The bill encourages states to include juvenile records in the National Instant Criminal Background Check system with grants, as well as implement a new protocol for checking those records. It gives NICS three days to review an individual’s record. If something potentially disqualifying comes up, NICS gets an additional seven days. If the review is not completed by then, the gun transfer goes through.

Creates new federal statutes against gun trafficking and straw trafficking

The legislation makes it easier to go after those who are buying guns for individuals who are not allowed to purchase weapons on their own.

Increases funding for mental health programs and school security

This money is directed to a series of programs, many of which already exist but would be funded more robustly under the new law.

This story and headline have been updated with additional developments.

CNN’s Clare Foran contributed to this report.