"While traveling back to Los Angeles after hosting a voter registration event in San Diego, a car carrying Will Ferrell and three of his colleagues was struck on the freeway by another vehicle," read a statement Ferrell's representatives from United Talent Agency. Ferrell and another passenger were "unhurt" and were released from an Orange County hospital, according to UTA. Ferrell's longtime driver, Mark Thompson, and his another passenger, identified as Carolina Barlow, remain hospitalized in stable condition, the statement said. Ferrell is "staying close by as his friends are being treated, and has expressed his deep gratitude to the first responders who were immediately at the scene and to the hospital team that took such great care of them," the statement added. Ferrell, 50, was a passenger in an SUV that overturned during a two-car accident late Thursday in Orange County, according to an accident report from the California Highway Patrol. According to the accident report, Ferrell's vehicle was struck when another car veered into its lane. Ferrell's SUV then struck the center divider median and subsequently overturned.On Thursday night, Ferrell appeared at a Funny or Die event in San Diego called Glam Up the Midterms. He appeared as his "Anchorman" character Ron Burgundy alongside Billy Eichner, who hosted the evening. Ferrell, best known for playing anchorman Burgundy and various other "Saturday Night Live" characters, was reportedly returning from that event at the time of the accident. The statement from Ferrell's representatives added that the actor is "grateful for all the well wishes he and his friends are receiving."CNN's Chloe Melas contributed to this report.