text: gay witch hunt " gay witch hunt " is the third season premiere of the american comedy television series the office , and the show 's twenty - ninth episode overall . written by executive producer and show runner greg daniels and directed by ken kwapis , the episode first aired in the united states on september 21 , 2006 on nbc . the series depicts the everyday lives of office employees in the scranton , pennsylvania branch of the fictional dunder mifflin paper company . in the episode , michael scott ( steve carell ) discovers that oscar martinez ( oscar nunez ) is gay . michael tries to show oscar that he is accepting of his sexual orientation , but only ends up insulting him . it is also revealed that after kissing pam beesley ( jenna fischer ) , jim halpert ( john krasinski ) went through with transferring to stamford . in addition , pam called off her engagement with roy anderson ( david denman ) . the episode features a kiss between michael and oscar . this scene was not scripted , and was an improvised moment courtesy of carell . an estimated 9 . 1 million viewers watched the episode , a 23 percent increase from the previous season premiere " the dundies " . " gay witch hunt " received positive reviews from television critics . plot after calling oscar martinez ( oscar nunez ) " faggy " , michael scott ( steve carell ) learns that oscar finds the word offensive because he is homosexual . michael inadvertently outs oscar to the entire office . jan levenson ( melora hardin ) berates michael for his behavior , after michael 's seminar on homosexuality is a disaster . when oscar threatens to quit , michael attempts to reconcile with oscar , first by hugging him , and then kissing him on the lips . oscar is given three months paid vacation and use of a company car in exchange for not suing dunder mifflin . it is revealed that after their kiss , pam beesly ( jenna fischer ) confirmed to jim halpert ( john krasinski ) her intention to marry roy anderson ( david denman ) . however , a few days before the wedding , pam got cold feet and decided to call it off . she moved into her own apartment and began taking art classes . pam 's rejection sent roy into a downward spiral , hitting rock bottom with a drunk driving arrest . when being interviewed by the camera crew , roy makes a vow to win pam back . jim has transferred to dunder mifflin 's stamford branch and settles into his new office . he befriends smug co - worker andy bernard ( ed helms ) who brags about his wild college days at cornell university . meanwhile , sales representative karen filippelli ( rashida jones ) is disconcerted by jim 's constant smirks to the camera . mr. brown ( larry wilmore ) is briefly seen giving the stamford branch a diversity day seminar due to " more problems at the scranton branch . " dwight had contacted jim in stamford regarding a " gaydar " device . in the final moments , dwight opens a package from jim , a novelty " gaydar " machine fashioned from a metal detector and lettered with the prefixes " homo " and " " . he confirms the device on oscar , but is dumbfounded when the device goes off as he inadvertently swipes it across his own belt buckle . pam is then seen smiling to herself . production " gay witch hunt " was the eighth episode of the series directed by ken kwapis . kwapis had previously directed " pilot " , " diversity day " , " sexual harassment " , " the fire " , " the fight " , " booze cruise " , and " casino night " . " gay witch hunt " was written by executive producer and show runner greg daniels . the kiss between michael and oscar in the conference room was not scripted . the scene had been shot a couple of times with steve carell not kissing oscar nunez . then on one take , oscar saw " [ carell 's ] lips coming closer and closer " . nunez recalled " i 'm like , ' dear god , he 's going to kiss me . ' and sure enough , he planted one on my face . " the other cast members were laughing during the kiss but because the camera stays focused on carell and nunez , the scene was still usable . at paleyfest in early 2007 , steve carell later recalled that he enjoyed the episode " because it spoke to the fact that michael is not a ; he just doesn 't understand the world . they are two very different things . it 's not that he 's intrinsically racist or homophobic or sexist , he just doesn 't have a frame of reference . he 's not capable of understanding . and once he does glean some understanding he misinterprets it into something altogether . but i think at least the way i feel about the character is he 's a decent heart , a decent person and he 's just trying his best . " the third season dvd contains a number of deleted scenes from this episode , including karen pulling a prank on jim by setting his dial tone to call hong kong , andy comparing his jumping skills to michael jordan to jim , michael asking pam how she is holding up since the wedding broke off , and jan being furious at michael . reception " gay witch hunt " first aired on nbc on september 21 , 2006 . the nielsen ratings for " gay witch hunt " indicated that it was watched by approximately 9 . 1 million viewers , a 23 percent increase from the second season premiere " the dundies " . during its timeslot , " gay witch hunt " ranked second among men ages 18 – 49 and 24 – 54 , and first among men ages 18 – 34 . " gay witch hunt " generally received praise from critics . tv guide 's matt roush admitted that he " loved oscar 's self - deprecating reaction to his newfound notoriety " . roush said that when watching michael " you can 't help but forgive the idiot , while wondering how in the world he manages to keep his job , " and that the kiss between michael and oscar was " horrifically funny " . brian zoromski of ign rated the episode with a 9 out of 10 , an indication of an " amazing " episode . he observed that the episode 's best scenes " show the impact of jim and pam being in different offices , " and thought andy 's reactions made the audience appreciate dwight more . steve west of cinemablend stated that " the balance between laughing at michael ’ s ineptitude and the of oscar was handled so deftly that it ’ s a wonder the show became successful when similarly great writing in arrested development did nothing to garner viewers . " for his work on this episode , greg daniels won the primetime emmy award for outstanding writing for a comedy series . ken kwapis also received a primetime emmy award nomination for outstanding directing for a comedy series for his work on this episode as well , but lost to ugly betty 's richard shepard for his work on the pilot episode .