On a muggy July evening, hundreds of people are queueing to enter a shiny studio at the BBC's new MediaCity centre in Salford: we are all here to watch the filming of an episode of BBC1's new comedy, Citizen Khan. Created by and starring Adil Ray – more commonly known as a BBC radio and TV presenter – it also has the distinction of being the BBC's first Asian sitcom. That's ever. But more on that later.

Citizen Khan's comedy mostly takes place in the twin hubs of Mr Khan's life: the mosque and the family home in Sparkhill, Birmingham. The set is fantastically well-observed, from the clear plastic covering on the chintzy sofa – a familiar sight to many of us who grew up the children of immigrants – to the violently orange 70s-style kitchen counter tops. The next day, I meet Ray to talk about the show and its self-proclaimed "community leader" star. Mr Khan is an amalgamation of several people, says Ray, from "intriguing" relatives to the neighbours he watched and did impressions of while growing up in 1970s Birmingham. "He's a Pakistani Muslim, and since 9/11, we've seen more and more characters come on TV and represent their communities, maybe not by their choosing," Ray says. "Local news may well have put this person with the longest beard in front of a mosque and asked him a question about something happening 5,000 miles away. This person doesn't really have an answer to it but looks into the camera and goes: 'Oh, this is my time. Let me have my five minutes.' Maybe there's a bit of that to him." More than anything and like all of us, Ray says, Mr Khan just wants to be liked and admired.

The character was one of several Ray created while presenting a late-night music and comedy show for the BBC Asian Network. He had a meeting with then BBC3 controller Danny Cohen, which indirectly led Ray to the door of BBC casting director Tracey Gillham. A year after their meeting he got an email: Paul Whitehouse and Charlie Higson were looking for people for their new show. It was Bellamy's People, a spin-off of their Radio4 spoof chatshow Down the Line. "I did Mr Khan in front of Paul and Charlie in London and they loved it," he says.

The pair gave him room to perform, he adds. "It was all improv. They gave us topics and then we just went on location and got on with it." Mr Khan then went on to star in short clips for BBC Comedy, talking about topics such as the general election, cricket and Christmas.

This has been quite a leap for someone with no real background in acting. Cheryl Taylor, former controller of comedy commissioning at the BBC, says Ray is unusual. "He introduced himself to me, and I get quite a lot of people doing that," she says. "Often, I think, 'Well, good luck – don't give up the day job,' because that's just the way it works. When I met Adil, I thought: 'Well, there's something about you.'"

The character was noticed by Mark Freeland, head of in-house comedy. "Mark realised very quickly that [Mr Khan] was very much like the characters which are giving us our biggest laughs and biggest audiences at the moment," says Taylor. "They're slightly larger than life, there's quite a lot of physical comedy involved, but they're very accessible."

Initially, Ray was writing solo, in the style of a mock documentary, but when they decided to go for a sitcom format, two writers came on board: Anil Gupta and Richard Pinto, alumni of Goodness Gracious Me, The Kumars at No 42 and Armstrong and Miller. They worked on a script for the Salford Sitcom Showcase, a sort of X Factor for new shows. "It's fair to say that Citizen Khan was the standout show in that it got commissioned as a series within 24 hours," says Taylor. "Everyone had the sense that a star was being born – people started laughing even before Adil came on the set. It was really extraordinary." Less than a year later, they were recording in a studio. "I think that's a record."

Mr Khan doesn't look like too many lead sitcom characters I've seen, I say. "Is it because he's brown," Ray asks me, before laughing loudly. Well, yes. It is the unspoken question: how, in 2012, is Citizen Khan the BBC's first British-Asian sitcom? Taylor maintains that comedy, regardless of who is in it, is hard to get right. "We get far fewer sitcoms and long-form comedy scripts submitted by black and Asian writers," she says. "And I think it's across the board in terms of sketch shows, and possibly radio. At the BBC, it's well-documented that we're very anxious to give the audiences as wide and diverse an experience as possible. But obviously, if it's a comedy, it has to be funny. The conversion rate is quite low. It's just one of those things."

Ray agrees. "Comedy is notoriously hard. I don't think commissioners can decide: 'Well, we need to have an Asian comedy, we need to go and find a black comedy.' That would be wrong and it wouldn't be very good. Things like Goodness Gracious Me, The Real McCoy and Desmond's – they were so good, so right for their time, how do you better that? You've got to find something else, other than it just being Asian or black. It's got to be strong and it's got to be character-led, and all in the right context and there's got to be a desire for it."

Ray believes there is already a lot of programming in place for minority audiences. "I've been working in radio for 17 years; I worked in Asian radio and television. But I think we have to be very aware of this: it's a population of 60 million, of which Asians are only two million," he says. "I think sometimes we probably expect there to be more than there really should be. The majority of this country is still massively white. If you break it up proportionally, you might think, actually, we probably are about right." And minorities are not the only ones who yearn for something different. "There's a certain sort of middle-class, Footlights white comedy, and it's only in recent years have we seen a return to more working-class comedy," he says. "I think there's a whole group of people who perhaps aren't represented enough."

The internet is changing that, although Ray cautions against getting caught in the hype machine of huge online hits. "It's a very dangerous game. I think just because lots of people have seen something on YouTube, it doesn't necessarily translate into a fantastic TV show. In the end, it's still got to be a great character and it's got to be well written and well thought out and there's got to be a future to it."

Citizen Khan's future already seems bright. "I would love us to have a 10th series of Citizen Khan further down the line," says Taylor. "I'd commission a second series today." For Ray, it's a dream come true. "I'm so grateful," he says. "Just at a time in my career when I thought I'd be presenting radio, I've had to learn something new with great people. My dream would be for Citizen Khan to run and run, for people to talk about it and reference it and connect with it. I want this family to be right in the hearts and minds of people of Britain."