"American Idol" judge Jennifer Lopez recently took to Instagram to share a photo of her and best friend Leah Remini after they had a car accident.

"Sitting at a light, Riding high right before some drunk fool rear ended us in my new whip!!! Thank god everyone ok!!!" Lopez captioned the photo.  

Iggy Azalea's "Booty" collaborator also added the hashtags, "#GRATEFUL #THANKYOUGOD #DontdrinkandDrive!!!! #cursedthatfoolout #theBronxcameout #dontmesswithmycocnuts #mamabear #leahstayedcalm #thatwasweird."

When the accident took place, it was Remini who was driving while Lopez was with her six-year-old twins Max and Emme at the backseat, law enforcement sources told TMZ.

Riding along Pacific Coast Highway in Malibu, they stopped at a light when a driver in a small pickup hit them from behind. The driver then took off so Lopez and Remini called 911 and described the driver and the pickup.

A short distance away, the driver was caught and determined to be driving under the influence and was arrested for DUI and hit and run.

Lopez, Rimini and the kids apparently did not suffer injuries due to the accident.  

Hours before they were rear ended, Remini posted a photo of her daughter Sofia with Lopez's twins with a caption "#Repost from @jlo with @repostapp --- These three cuties make my day!! #Coconuts #Sofia #lunchwthekiddies #bigpimpin' #brooklynindahouse."

Lopez also posted a video of her son Max to Facebook hours before the accident with a caption, "Is New York in da house...? #hegititfromhismama #boyknowsahit #mylittleman #LOVE!"

On Sept. 25, Thursday, Lopez and Remini were spotted dining together at Ago restaurant in West Hollywood, Daily Mail reported.

On Sept. 18, Lopez debuted her "Booty" video with "Fancy" hit maker Azalea, which garnered 11 million views in 24 hours and has since racked up more than 39 million views.

"Booty" is part of Lopez's "A.K.A." album, which was released in June and opened to first week sales of 33,000 in the United States marking the weakest in her music career.