*Chris Brown and his baby mama Nia Guzman have at last reached a settlement in their messy custody war over daughter Royalty, including an agreement on her last name.

According to sources for TMZ, the couple has agreed to joint physical and legal custody. Breezy will get their 1-year-old 12 days out of the month, and there will be no supervised visitation.

The child will be known as Royalty Brown, with no middle name.

According to TMZ, Chris will pay Nia $2,500 a month, in addition to the $15,000 a month he’s paying her in back support.

Chris also has to pay for Royalty’s education, health insurance, medical bills and nannies.

TMZ also reports that the drug test Chris submitted to during the custody hearing has come back positive for both weed and codeine, but he had a prescription for both.

The settlement is subject to a judge’s approval.