Khaled Hosseini worked as a medical internist at Kaiser Hospital in Mountain View, California for several years before publishing The Kite Runner. In 1999, he learned through a news report that the Taliban had banned kite flying in Afghanistan, a restriction he found particularly cruel. The news "struck a personal chord" for him, as he had grown up with the sport while living in Afghanistan. He was motivated to write a 25-page short story about two boys who fly kites in Kabul. Hosseini submitted copies to Esquire and The New Yorker, both of which rejected it. He rediscovered the manuscript in his garage in March 2001 and began to expand it to novel format at the suggestion of a friend. According to Hosseini, the narrative became "much darker" than he originally intended. His editor, Cindy Spiegel, "helped him rework the last third of his manuscript", something she describes as relatively common for a first novel.
As with Hosseini's subsequent novels, The Kite Runner covers a multigenerational period and focuses on the relationship between parents and their children. The latter was unintentional; Hosseini developed an interest in the theme while in the process of writing. He later divulged that he frequently came up with pieces of the plot by drawing pictures of it. For example, he did not decide to make Amir and Hassan brothers until after he had "doodled it".
Like Amir, the protagonist of the novel, Hosseini was born in Afghanistan and left the country as a youth, not returning until 2003. Thus, he was frequently questioned about the extent of the autobiographical aspects of the book. In response, he said, "When I say some of it is me, then people look unsatisfied. The parallels are pretty obvious, but ... I left a few things ambiguous because I wanted to drive the book clubs crazy." Having left the country around the time of the Soviet invasion, he felt a certain amount of survivor's guilt: "Whenever I read stories about Afghanistan my reaction was always tinged with guilt. A lot of my childhood friends had a very hard time. Some of our cousins died. One died in a fuel truck trying to escape Afghanistan [an incident that Hosseini fictionalises in The Kite Runner]. Talk about guilt. He was one of the kids I grew up with flying kites. His father was shot." Regardless, he maintains that the plot is fictional. Later, when writing his second novel, A Thousand Splendid Suns (then titled Dreaming in Titanic City), Hosseini remarked that he was happy that the main characters were women as it "should put the end to the autobiographical question once and for all".
Riverhead Books published The Kite Runner, ordering an initial printing of 50,000 copies in hardback. It was released on May 29, 2003, and the paperback edition was released a year later. Hosseini took a year-long absence from practicing medicine to promote the book, signing copies, speaking at various events, and raising funds for Afghan causes. Originally published in English, The Kite Runner was later translated into 42 languages for publication in 38 countries. In 2013, Riverhead released the 10th anniversary edition with a new gold-rimmed cover and a foreword by Hosseini. That same year, on May 21, Khaled Hosseini published another book called And the Mountains Echoed.
Following The Kite Runner's success, Hosseini continued to work as a physician for another year and a half before becoming a full-time writer. "Medicine was an arranged marriage, writing is my mistress," he explains, employing a quote from Chekhov.