Mellouli, who took bronze in the 1500m Freestyle in the pool last week, was followed home by the German Thomas Lurz who took silver.
The bronze medallist was Richard Weinberger of Canada.
When he won gold in the 1500m Freestyle in Beijing, Mellouli became the first African male to win an individual Olympic Swimming title and victory today saw him become the first swimmer to win an Olympic medal in the pool and open water at the same Games.
Although open water was only introduced four years ago, Mellouli, who beat his chest on finishing, has now set a precedent.
Mellouli said: 'I can't explain it, I can't really describe it.
'I don't think this has ever been done before. This is probably one of the toughest things to do.
'I'm a pretty solid guy and I never react but you saw that reaction, that says it all.'