The Bisbee City Council approved the law 5-2 after an emotional three-hour public hearing, the Sierra Vista (Ariz.) Herald reported Tuesday.
Anticipating state challenges to the ordinance, City Attorney John MacKinnon said he would defend the city free of charge from any potential lawsuits.
The ordinance has force only within the Bisbee city limits, The Arizona Republic reported.
It grants the same rights that married couples have, including inheritance, property ownership and adoption.
Attorney General Tom Horne had warned the city it faced legal action if the ordinance was passed.
Horne said the act sought to change seven state laws. In a statement, he said, "The only proper way to change a statute is through the Legislature, not through actions of the city council attempting to change a state statute within its boundaries."
On Monday, the Center for Arizona Policy, a conservative advocacy group, threatened to sue the city if it allowed civil unions.