Wilfredo Reyes was in the car from which Edwin Ramos shot and killed the three members of the Bologna family, whom he mistook for rival gangsters. Reyes was arrested in North Carolina in July 2012.

Danielle Bologna, who was made a widow by the preventable crime, has been in witness protection for seven years for fear of other diverse gangsters and made an emotional statement to the court that justice cannot be served in this lifetime for the loss of her husband and sons.

She also urged officials to prioritize public safety: “Violent criminals, convicted felons and gang members illegally in the United States should not be shielded by any law enforcement agency. I am begging community leaders to put public safety first so another preventable tragedy for another family is avoided.”

Unlike his gangster pal Ramos, Reyes is not an illegal alien and cannot be deported after serving his prison term. America now has generations of criminal diversity preying upon us.

In a matter of minutes, seven years of wrenching uncertainty ended for a onetime San Francisco family shattered by tragedy.

Wilfredo “Flaco” Reyes, a suspected leader of the MS-13 gang, was sentenced Friday to 10 years in state prison for his role in the mistaken-identity murders of a father and two sons, closing the final chapter of one of the city’s most notorious crimes.

Tony Bologna, 48, and his sons Michael, 20, and Matthew, 16, were driving just a few blocks from their home in the Excelsior neighborhood in June 2008 when their car was riddled with bullets. A third son, Andrew, survived the attack.

Prosecutors do not believe that Reyes was the shooter but that he was in the car.

“This is for my husband, Tony, my son Michael and my son Matthew Bologna,” Danielle Bologna, who supported Reyes’ plea deal, said through tears in San Francisco Superior Court. “It’s been a long seven years for justice, and we are finally here.

“You have taken so much away from us,” she said to Reyes. “I had a whole family and on the day of June 22, 2008, you destroyed it.”

Investigators determined that the Bolognas were killed in a mistaken gang shooting by Edwin Ramos, another alleged member of MS-13. He was convicted of their murders in 2012 and sentenced to three consecutive life sentences without the possibility of parole.

Ramos admitted driving the other car, but testified that Reyes had leaned over from the passenger seat and fired the shots, in revenge for the shootings of two MS-13 members earlier that day. Prosecutors believe Ramos was lying about who pulled the trigger.

The case drew controversy when it was revealed that Ramos had, before the killings, been shielded from deportation twice after he committed gang-related crimes as a minor by city juvenile justice officials relying on San Francisco’s sanctuary city law.

That law has been expanded since and, this week, has come under intense scrutiny after a man who was released from County Jail — despite a federal request that he be turned over for deportation — allegedly shot and killed a woman on the Embarcadero.

Justice for Reyes, 34, was delayed because he was on the lam. He was taken into custody in Salisbury, N.C., in July 2012.

Adding another layer of discord in the case, Ramos’ attorneys contended that authorities long knew Reyes was hiding out in South Carolina, but did not swiftly apprehend him in order to make a cleaner case against Ramos.

Reyes pleaded guilty to participating in a criminal street gang and discharging a gun at an occupied vehicle in exchange for the 10-year sentence, which includes two strikes under the state’s “three strikes” law.

In court, Danielle Bologna said no sentence was long enough for the men convicted of killing her husband and sons, but that she wanted to put the case to rest and move forward with her two surviving children.

“Ten years, 100 years, 1,000 years will never be enough for that you did,” she said to Reyes. “I have to ask myself, has justice really been served today? No. But you will be judged again by our heavenly father. And that day, justice will be served.”

Reyes stood impassively, and neither he nor his attorney took an opportunity to address the court.

“Under the circumstances, the offer of 10 years was an acceptable offer for my client,” his attorney,Christopher Morales, said after the sentencing. “It was a great tragedy and the Bologna family has suffered greatly here. We wish them the best.”

Outside court, Marti McKee, a spokeswoman for the Bolognas, said the gang element of the case had forced the family to leave their home in San Francisco and take “enormous security precautions.”

McKee also released a statement from Danielle Bologna on the July 1 shooting of 32-year-old Kathryn Steinle on the Embarcadero.

Danielle Bologna has long said that the shooting that killed her husband and sons was preventable, and sued the city in 2009 for shielding Ramos. A judge threw out the suit.

“Violent criminals, convicted felons and gang members illegally in the United States should not be shielded by any law enforcement agency,” she said in her statement. “I am begging community leaders to put public safety first so another preventable tragedy for another family is avoided.”

She said she understood that “most immigrants who come here do so to have a better life and are trying to do just that. But those that come into our communities and commit serious crimes should not be released back to our communities to see what happens next.”