O'Sullivan, who has been lacking confidence ever since her failure to win the Olympic 5,000m in Atlanta in 1996, pulled away from Great Britain's Paula Radcliffe in the final stages of the 8km race. The 1996 winner, Gete Wami of Ethiopia, ended up in third place.
O'Sullivan, who recorded an impressive three-second victory in a time of 25min 39sec, said: "After all I've been through, it's a great day for both Ireland and myself. I've stopped looking backwards now. All I am doing now is looking towards the future and trying to perform positively."
Radcliffe, who finished runner-up for the second consecutive year, helped the British women to take third place overall in the team event. Kenya claimed the gold while Ethiopia finished in second.
Radcliffe's pre-race plan was to make a long run for home but she was upstaged by the resurgent O'Sullivan. "I know Sonia has been running well this winter but I never expected her to be so strong in the final kilometre," Radcliffe said.
"I am in the best shape of my life and was cruising along throughout the race. But when I made my move, Sonia just pulled away from me."
Disaster nearly struck in the last 1,000m. As O'Sullivan, followed by Radcliffe, forged ahead, they were both directed off the course by a marshal. Fortunately, Cannock's Spencer Duval, spectating before his own race, realised the error and, by tearing down the course barrier, allowed them both to return to the correct channel.
The men's 4km event was dominated by the Kenyans who took the first five places. The winner, John Kibowen, missed the Kenyan championships short-course race when he was stuck in traffic, but won selection for the team anyway.
Daniel Komen, the world champion and world record holder over 5,000 metres, took the lead twice but could not summon a finish fast enough to head off Kibowen who finished in 10min 43sec. Komen was second and Paul Kosgei finished third in 10min 50sec.
Kibowen, seventh-ranked in the world over 1500m last year, said he planned to attack Noureddine Morceli's world 1500m and mile records later this year. "I had it in my mind to go fast from the start," he said.
Komen said he was not disappointed at finishing second and was satisfied to be part of Kenya's team title. "I helped Kenya win a good race," he said.
In the first race of the day, the British junior women were never in contention as Ethiopia's Yimenashu Taye won the 6km race in 19min 32sec. The winners denied Kenya the title they have won for the previous five years.