The settlement follows the acquittal of Yanez on June 16 of second-degree manslaughter and two counts of intentional discharge of a firearm that endangers safety.
Castile was killed July 6, 2016, during a traffic stop, and his death, as well as the acquittal of Yanez, have drawn protests across the country.
The settlement over his death is the second major settlement to be awarded to police shooting victims' families in recent days.
"Under the terms of the settlement, Valerie Castile, as trustee, will receive a payment in the amount of $2.995 million," the statement says. "The settlement will be paid through the city's coverage with the League of Minnesota Cities Insurance Trust."
The statement notes that no taxpayer money from St. Anthony Village will be used to fund the settlement and that the family intends to "deal with their loss through the important work of the Philando Castile Relief Foundation," a nonprofit created to help victims of gun violence.
New dashcam video, which was released last week, reopened old wounds for those who were outraged by his death.
Yanez, who is Latino, encountered Castile, 32, while investigating a broken taillight on his vehicle.
Diamond Reynolds, Castile's girlfriend, was in the car with him at the time of the shooting, along with her 4-year-old daughter.
Reynolds live-streamed the aftermath of the shooting on Facebook Live, helping make it a national news story.
The dashcam video shows Yanez saying, "OK. Don't reach for it," referring to a firearm Castile reported that he had.
"Don't pull it out," Yanez says, repeatedly, as he appears to draw his own weapon.
He fires multiple rounds into the car, and Reynolds can be heard screaming in the car.
The joint statement attempts to address the communal rift opened by Castile's shooting death and says that the city is working to "rebuild trust" between the police and those they serve.