Dr. Dre -- who has become one of music's richest businesspeople and works with Apple -- said the album would come out on August 7, a week before the biopic "Straight Outta Compton" opens in US cinemas.
The album will feature collaborations with his protege Eminem, former N.W.A. bandmate Ice Cube and fellow Los Angeles-area rap giants Kendrick Lamar and Snoop Dogg, according to the pre-order information on Apple's iTunes.
The rapper, whose birth name is Andre Romelle Young, said he decided to record the album -- entitled "Compton: A Soundtrack by Dr. Dre" -- during the filming of "Straight Outta Compton."
"I felt myself just so inspired by the movie that I started recording an album," Dr. Dre said late Saturday on his show on Apple Music, the tech giant's new streaming and radio service where he has played a prominent role.
"I started recording a soundtrack. I kept it under wraps, and now the album is finished," he said.
Dr. Dre. indicated that the album would be his last, writing on Twitter that it was "my grand finale."
N.W.A -- which stands for Niggaz Wit Attitude -- shocked much of white America in the late 1980s with its unapologetic takes on street life through songs such as "Fuck Tha Police."
From his humble upbringing, Dr. Dre went on to develop headphones and other audio products under the name Beats Electronics, which Apple bought last year for $3.2 billion.
Forbes this year estimated his net worth at $700 million.
While focusing on the music business, Dr. Dre has not released a solo studio album since "2001," which despite its name was released in late 1999.
For years he has been reported to be working on an album called "Detox," but he said on his radio show that he had abandoned it.
"This is something you're not going to hear many artists say. The reason 'Detox' didn't come out was because I didn't like it. It wasn't good," he said.