Ramos was born in El Salvador, where he was raised by his grandmother. The San Francisco Chronicle reported in 2008 that Ramos illegally entered the United States when he was 13 to live with his mother and two siblings, but later reports suggested that Ramos was a legal immigrant whose visa expired. In 2003, Ramos's mother reported him missing, and Ramos returned 11 days after his mother reported. On October 22 that year, Ramos was also one of three MS-13 members suspected of assaulting a man on a Muni bus for claiming not to be a gang member. Juvenile Court convicted Ramos of assault and street gang membership and put him in a shelter. On probation, Ramos was released to his mother's custody on April 2, 2004, but four days later he assaulted a pregnant woman and her brother. Ramos was convicted of attempted robbery, a felony offense, but was cleared of assault and served probation at the city-run Log Cabin Ranch where he lived from June 2004 to February 2005. ("The purpose of the facility is to provide a twenty-four-hour-a-day residential program for juveniles of San Francisco who have been adjudicated delinquent by the Juvenile Courts and sent to Log Cabin for treatment and rehabilitation.")
After his release, he lived with his mother's sister. He applied for temporary residency but was declined; by then federal authorities had learned that Ramos was in the U.S. illegally and considered Ramos deportable. After marrying Amelia Martinez, a woman who was a U.S. citizen, Ramos applied again for citizenship; his application was still pending as of 2008. They had a daughter, Jasmine, in 2007. Amelia's mother, Rosa Martinez, knew that Ramos worked at City Auto Supply in South San Francisco and believed that Ramos was a gang member, thus warning Amelia not to marry Ramos.
In 2006, former MS-13 leader turned informant Jaime Martinez, uncle of Ramos's wife, told the FBI that Ramos killed 21-year-old Norteño gang member Rolando "Chino" Valldares in the Mission District of San Francisco.
Having been a member of the 20th Street MS-13 gang in San Francisco, Ramos later moved to El Sobrante and joined MS-13 ally Pasadena Loco Sureños (PLS). On March 30, 2008, Ramos was arrested after police discovered his car had illegally tinted windows, no license plate, and a passenger named Erick Lopez who tried to conceal a gun that police found was used in a double killing. According to the police report, Ramos cooperated with police, but Lopez ran away but was later caught and arrested. Police had "numerous documented contacts" with Ramos and Lopez and identified both as active MS-13 gang members. Prosecutors declined to charge Ramos due to lack of evidence that he knew about the gun. San Francisco sheriff's deputies called Immigration and Customs Enforcement (ICE) to determine if the department wanted to hold Ramos in custody, but ICE declined.
On June 22, 2008, Tony Bologna and his sons, Michael and Matthew, were shot dead near their residence in the Excelsior district of San Francisco as they returned home in the afternoon from a family barbecue in Fairfield. Bologna was on his way home to rest before reporting to his job as night manager at a supermarket later that afternoon. Another one of Tony's sons was critically injured. Jaxon Van Derbeken of the San Francisco Chronicle reported the incident initially as one of road rage. Ramos was arrested and booked on murder charges three days later without bail.
Preliminary hearings were held in June 2009. The only survivor of the shooting identified Ramos as the shooter. In September 2009, the San Francisco Chronicle reported that Douglas Largaespada, an alleged MS-13 member, claimed that Ramos killed the Bolognas. Marvin Medina, who was injured in a shooting hours before the Bolognas were shot, testified in court in exchange for prosecutorial immunity. He repeatedly denied knowing Ramos or other MS-13 gang members; prosecutors questioned Medina to determine whether Ramos was seeking retaliation for the shooting of Medina in killing the Bolognas. However, Medina could not explain why he was driving around the San Francisco Mission District for two hours the day before he was shot and why he called several people but not 911 after being shot. On June 24, Sergeant Mario Molina, a San Francisco police officer who was an expert on Latino gangs, testified that Ramos thought the Bolognas were rival Norteños gang members. San Francisco Superior Court Judge Teri Jackson ruled on June 29 that Ramos would stand trial for three counts of murder, and Ramos pleaded not guilty on July 13. According to Sgt. Molina, Ramos stated that his friend Wilfredo "Flaco" Reyesruano, whom police identified as a leader of MS-13, shot the Bolognas. San Francisco District Attorney Kamala Harris sought a maximum sentence of life in prison without parole rather than the death penalty should Ramos be convicted. Mayor Newsom supported Harris's decision.
Harry Dorfman and George Butterworth represented the prosecution; Marla Zamora represented Ramos in court. Judge Jackson removed Ramos's previous lead defense attorney Robert Amparan on January 7 because Amparan was representing Douglas Largaespada at the time.
Marvin Medina admitted on December 1, 2009 that he lied on the stand six months earlier and could not explain how Ramos obtained his cell-phone number. Additionally, Medina identified Reyesruano as the shooter of the Bolognas. When prosecutors attempted to check for a gang-related tattoo, Medina admitted that he was a former MS-13 member. As a result, Medina pleaded guilty to three counts of perjury regarding his claims that he did not know Reyesruano, he only met Ramos once before the preliminary hearings, and he was alone when he was shot in 2008. Having been in jail since the preliminary hearings ended, Medina was sentenced to three years of probation on January 12, 2010 with credit for time served but remained held on $1 million bail as a material witness.
In May 2012, a jury in San Francisco convicted Ramos of killing the Bolognas and attempting to murder a surviving member of the family. Judge Charles Haines sentenced Ramos to 183 years to life without parole on June 11, 2012.
Tony Bologna's widow Danielle and other relatives of the slain family members blamed San Francisco's sanctuary city policies for the crime. The policy "bars city officials from cooperating with federal crackdowns on illegal immigrants." On July 2, nearly a week after the murder of the Bolognas, San Francisco Mayor Gavin Newsom amended the sanctuary city policy to allow the city to refer juvenile illegal immigrant felons to federal authorities for deportation. Members of the Minuteman Project, a group of private citizens who patrol the Mexico – United States border against illegal immigrants, held a protest at San Francisco City Hall on July 30 denouncing the sanctuary city policy and calling for Mayor Newsom to resign. Cinnamon Stillwell wrote a column criticizing the policy. Jesse McKinley of The New York Times cited the Ramos case as among several negative consequences of San Francisco's sanctuary policy. Danielle Bologna advocated for District Attorney Kamala Harris to seek the death penalty for Ramos; among her campaign promises, but Harris pledged never to seek capital punishment for any criminal case (though she initially claimed she would "think about it," then let a year go by before she quietly announced her decision not to seek the death penalty).
On August 22, 2008, Danielle Bologna and other family members sued San Francisco, claiming that its sanctuary city policy contributed significantly to the three deaths. The city removed Bologna's civil suit to federal court because Bologna's case involved violations of federal constitutional rights, and Judge Susan Illston ruled on September 14, 2009 that Bologna could sue San Francisco in state court. Judge Charlotte Woolard of San Francisco Superior Court ruled on February 22, 2010 that the city couldn't be liable for any crimes that Edwin Ramos committed post-release because the city had no information that Ramos posed a specific threat to the Bolognas and that the sanctuary city policy was intended "to improve immigration controls" rather than prevent crime.
Ramos appealed his case. "On appeal, he contends the court erred by admitting the following evidence at trial: (1) defendant’s allegedly involuntary incriminating statements made during extended police interrogation, (2) the lay opinion of the investigating police officer that defendant, rather than an accomplice, was the shooter, and (3) excessive, cumulative and prejudicial testimony about defendant’s membership and participation in a criminal street gang." The California Court of Appeal for the First District upheld Ramos's convictions but ordered a sentencing correction on August 20, 2014.