Guests including Young Ones co-star Nigel Planer and other fellow performers such as Ruby Wax, Jennifer Saunders and Dawn French were among mourners who attended the service at St George's Church in Dittisham, Devon.
Around 140 mourners attended, mainly dressed sombrely in black, to celebrate the career of the star, who died last week aged 56 at his home in Barnes, south west London.
Mayall - known for roles in TV hits such as Bottom, The New Statesman and The Young Ones - also had a home in Devon.
Others who filed into the church, accompanied by Procol Harum's A Whiter Shade Of Pale on organ, were Alan Rickman and actor and director Peter Richardson, a long-standing friend with whom Mayall had worked repeatedly, particularly on the Comic Strip Presents films which helped to establish their careers.
Ben Elton, his old friend from university and one of his co-writers on The Young Ones, was also among the mourners who saw the wicker coffin - adorned with red flowers - carried into the church.
The service, led by Father Will Hazlewood, celebrated the career of the famously foul-mouthed comic and the mourners were heard to cheer and clap within the church.
Adrian Edmondson, with whom Mayall forged a friendship as a student in Manchester and who was his comedy partner for many of his most memorable series, was among the pall-bearers as the coffin was led from the church.
Guests filed out to the sounds of the Van Morrison hit Brown Eyed Girl.
A vintage Rolls-Royce, which carried Mayall's family to the service, struggled to cope with the incline which led to the church holding up the vehicles taking guests away from the service.
Prior to the service, Mayall's widow Barbara asked fans for their "thoughts and prayers" during the private ceremony.
A memorial service for the star is expected to be held in September.
He collapsed and died following what was described as an "acute cardiac event".
Mayall shot to national fame for his role as poetry-writing anarchist Rick in The Young Ones, going on to star as conniving Conservative MP Alan B'Stard in The New Statesman and Lord Flashheart in Blackadder.