Before Avril Lavigne separated from her husband, Deryck Whibley, she enjoyed a summer of partying with Brandon Davis on a yacht on the French Riviera.

Lavigne announced she and Whibley had split on Thursday. But there were signs the 3-year-old marriage was “Complicated” (the pop tart’s biggest hit) when she spent four weeks reveling until dawn on a 100-foot yacht moored in St. Tropez harbor, rented by pals of the notorious party boy known as Greasy Bear.

Lavigne, who was vacationing with female friends, was spotted heading out night after night to Davis’ yacht, moving to the clubs at midnight, before partying until the early hours back on board. “She was seen downing shots, drinking booze from the bottle and play-fighting men on the beach,” said one French Riviera source. “She wasn’t acting like a married woman at all.”

Another source said, “Avril is not involved romantically with Brandon — they are just friends . . . she met Deryck when she was very young, and now she needs some freedom to live her life.”

Despite publicists’ denials that Lavigne’s marriage was on the rocks, when she finally returned to Los Angeles in late August, she remained distant from Whibley, the Sum 41 guitarist and singer.

After reuniting with Whibley earlier this month in Beverly Hills, they were seen together at a supermarket looking miserable. Lavigne finally announced the separation on her MySpace page this week.

She said in a statement: “Deryck and I have been together for 6½ years. We have been friends since I was 17, started dating when I was 19, and married when I was 21. I am grateful for our time together, and I am grateful and blessed for our remaining friendship. Deryck and I are separating and moving forward on a positive note.”

But the divorce could be messy because Whibley has written and produced tracks on Lavigne’s new album due out in November, and they share a $9.5M mansion in Bel Air.