Spears previously appeared in The Mickey Mouse Club and Crossroads
Pop star Britney Spears will guest on an episode of US sitcom Will and Grace to be shown in the US in April.
Spears, who released her most recent single in March 2005, gave birth to son Sean Preston last September.
The singer hosted US children's TV show The Mickey Mouse Club from the age of 11 and starred in the 2002 movie, Crossroads.
The 24-year-old married her second husband, dancer Kevin Federline, in September 2004.
Spears' appearance on Will and Grace follows cameo appearances by singers Jennifer Lopez and Cher and actor Michael Douglas, who played a gay policeman.
The NBC series began in 1998 and is broadcast in the UK on Living TV and Channel 4. The current eighth series of Will and Grace will be its last.