Genie of Agrabah

"In my time I have granted a thousand and one wishes, and I have seen them end poorly a thousand and one times. Making a wish comes with a price and that is why I will never use this wish."

The Genie of Agrabah is a supporting character on Once Upon a Time. A magic genie from the exotic land of Agrabah, in the fairytale world, he was forced by magic to grant three wishes to whoever found and rubbed the magic lamp in which he lived. The Genie is saved from his curse by the kind King Leopold, and they become trusted friends, but the Genie's feelings for the scheming Queen Regina prove to be harmful to him and to the King. The Genie later becomes trapped as the Queen's Magic Mirror, and after the Dark Curse is set in motion, he becomes trapped in Storybrooke as Sidney Glass, the head of the local newspaper and Mayor Mills' confidant.

Before the Curse
"You gave me my freedom. You gave me a chance to find love, and for that I'm forever in your debt. But just as you freed me, so must I now free your Queen."

King Leopold, on a morning walk through a local beach, finds a magic lamp washed ashore. He picks it up and rubs it, only to encounter a magic genie, the Genie of Agrabah, who lived in the lamp. The Genie, rather unceremoniously, tells the King that he can ask for three wishes, with some terms and conditions. The King, already satisfied with everything he has, wishes merely for the happiness of everyone who sets foot in his kingdom, and, upon hearing of the Genie's miserable life, requests for him to be set free. The Genie is therefore released from his curse, and the King gives him the final wish in the lamp. At the castle, the Genie meets Snow White, the beautiful young daughter of King Leopold, and the saddened Queen Regina. The Genie grows fond of the Queen, and notices her depression. The Queen tells him that she knows the King will never love her as much as he loved his first wife, so she feels trapped in a rather loveless marriage. The Genie, to lift up her spirits, offers the Queen a small mirror, so she can see herself the way he sees her: as the fairest in all the land. The King, from reading his spouse's diary, learns that she is smitten with another man, and requests that the Genie find the identity of the person who gave her the mirror. The King then locks her up in a tower, and Henry, the Queen's father, brings his daughter a chest with two deadly vipers from the land of Agrabah.

Regina tells the Genie that they are her way out, but he stops her from committing suicide, planning to use the snakes to kill the King instead. He does just this, and tells the King, in his death bed, that he is forever grateful to Leopold for having set him free, but now it is his duty to set the Queen free. The King shows repent in helping the Genie, and passes away. Later, however, the Genie learns he was set up to take a fall by the scheming Queen. It was her plan all along that the Genie be blamed for the King's death, seeing as how the guards now know he is behind everything because the snakes were from his land. The Genie claims to be unable to live on without the woman he loves, so, in order to both stay by her side and punish her, he uses up his last wish to never leave her side. However, this backfires to an extent, for he is magically turned into the Queen's reflection, forever trapped in her mirrors.

Following the death of her father, Snow White seeks comfort in her stepmother, all the while unbeknownst to the fact that she was the one responsible for his passing. The Magic Mirror congratulates Regina, because her plan is moving along smoothly. Regina tells the Mirror that they must be delicate in the next phase, because Snow's death needs to be handled with care. The Mirror suggests that one of her knights kill her, but Regina claims that it has to be someone with no heart. "Well, in that case...", the Mirror says, "You need a huntsman." Regina is delighted with this idea, and she then hires the Huntsman to kill Snow.

When the Queen wants Jefferson to help her with a favor, she poses as an old woman selling stuffed animals at a fair. Young Grace is enchanted by a stuffed white rabbit, and Jefferson wants to buy it for her, but he doesn't have enough money. The old woman, whilst acknowleding the fact that the man is a good father, still refuses to sell the rabbit for less than its worth. Jefferson leaves, humiliated, and when the woman reveals herself before her mirror, the reflection of the Genie tells her that she was being cruel, because she could at least had allowed the girl to keep the toy, to which the Queen replies, "Where's the fun in that, hmm?".

After Prince Charming wakes Snow White up from the sleeping curse inflicted upon her by the Evil Queen, the Magic Mirror is anxious to tell his beloved Queen the news, and has a black knight rush him over to her. In the meantime, he tells the knight that, should he drop the mirror, the Genie will make sure he gets fourteen years of bad luck for that. They interrupt the Queen's apple-picking activities and she isn't pleased. He shows her images of the prince and princess reunited, and the former asking the latter in marriage. The Mirror provokes the Queen by saying it will be quite the wedding, leaving no dry eye in the audience. Snow is then heard saying to Charming that they take back the kingdom, and Regina says, "We'll see about that..."

After the Queen threatens to destroy everyone's happiness at the wedding of Snow White and Prince Charming, she comes home to her castle and the Magic Mirror makes his face appear. The genie tells her that was an awfully big threat, and the Queen, with an evil smile on her face, walks up to the Mirror, and he asks her how she plans on accomplishing that. The Queen smirks as she answers with "The Dark Curse." The Mirror looks shocked. Henry, the Queen's father, walks up to his daughter, and asks her if she's sure. The Mirror reminds her that she said she'd never use it; Henry brings up the fact that she made a deal when she gave away that curse; the Mirror adds that she traded it away; and Henry comments that 'she' won't be happy to see her. The Queen turns to her father and says "Since when do I care about anyone else's happiness but mine?". She tells him to prepare the carriage, and Henry looks reluctant. "We're going to the Forbidden Fortress.", the Queen says, with a look of determination on her face.

Season 1
One morning in the lovely town of Storybrooke, Mayor Mills is picking apples from her backyard tree. Behind her appears Sidney Glass, the town's local newspaper's head, holding in his hands the newest edition of the paper. He says "The Mirror strikes again." She turns to him to see what it is, and learns that it is a cover of how Emma Swan wrecked the town's historic entrance sign. She takes the newspaper from his hands and comments that it's not what she asked for. She skims through it and asks what he found out about Emma. He tells her that there wasn't much; he says that she spent a lot of time in foster homes, and she snubs this. She continues searching for the proper apples and he walks around her, saying she got into some problems when she was a teen, but everything is locked up pretty tight, and since then she's clean. She did however bounce around a lot, and it appears as though she doesn't like to sit still. He asks the Mayor if she knew that Emma had Henry while she was in Phoenix, and then he asks her how Henry wound up in Maine. The Mayor scolds him for bringing her nothing of value, and threatens to dispose of him should he fail to be valuable again. Sidney, intimidated, tells her that he'll keep looking, and walks past her. The Mayor takes a further look at the newspaper.

A dart is seen hitting a picture of a deer. Graham is the thrower of said dart, and is preparing himself to throw another, within Granny's Diner. He throws the second dart, hitting the deer picture on the dart board in a similar place as before. "Nice shot, chief. I bet you twenty bucks you can't do it again.", says Sidney Glass, sitting in one of the diner's booths. Graham downs a drink which is served to him by Ruby, and he throws the dart, hitting the picture precisely in the deer's face. Sidney is surprised. Emma walks out of the bathroom and is surprised to see Graham, "Emma, what can I get you?", Ruby asks, "Nothing.", Emma states, walking past Graham and to the diner's door. As Emma is about to leave, Graham throws a fourth dart in her direction, it hits the door frame rigt next to her, she is startled, as is everyone else in the diner.

Following the untimely demise of Sheriff Graham, Regina stops by the station to tell Emma that she has appointed Sidney Glass to be the new sheriff, and that Emma is fired. However, Mr. Gold then stops by Emma's apartment to tell her that she has the right to run for the position of sheriff, so Emma starts her campaign, benefited by Gold. A discouraged Henry, however, tells his birth mother that Regina will always win because evil doesn't fight fair. This follows the publishing of an article by Sidney in the local newspaper about how Emma gave birth to Henry behind prison bars. Emma confronts Regina about it and learns that there will soon be a debate. Suddenly, when Regina opens a door, there is an explosion and she is injured, and thus Emma saves her from the fire. She is then applauded by the populus, who start rallying in her favor. This all lifts up Henry's spirits... but then Emma finds out that the explosion was set up by Mr. Gold, in order to boost Emma's chances. During the debate, Emma, with a guilty conscience, tells everyone the truth, and explains to them that she feels bad for letting everyone think her rescue of Regina wasn't premeditated. Everything works out right in the end when Regina and Sidney announce that Emma won the race, because people saw bravery in her when she stood up and spoke out against Mr. Gold, the most feared person in town.

Mary Margaret and Emma discuss Regina's evil ways, and Emma says she wishes everyone could see the effect Regina has on Henry. Sidney Glass, having been fired, hears this and offers to partner up with Emma to bring Regina down. When Regina orders the castle to be teared down, and the book goes missing, an irate Emma does team up with Sidney, and he tells her that he found out Regina moved thousands of the taxpayers' dollars to work on a secret project. They tap her office and learn she's meeting with someone to pay off something, and they follow her, but it turns out Emma's brakes have been cut. After they crash, they learn Mr. Gold was the person Regina was meeting with: she bought some land from him. They break into Regina's office and discover some documents that seem to indicate that she's building herself a second house. They try to shame her during a public assembly, but wind up embarrassed themselves when Regina reveals that those plans are to build a public playground for the children of Storybrooke. Later, it is revealed that Sidney was behind this all along, going so far as cutting the brakes himself, always working for Regina, so that they could humiliate Emma and be one step ahead of her at all times...

Emma is called to investigate the car crash and apparent disappearance of Kathryn Nolan, and Sidney, camera in tow, shows up at the site, fabricating a story around her disappearance. He offers assistance by telling Emma that he has a contact that can get them Kathryn's phone records fast, and suggests to her that David must have had something to do with his wife's sudden absence. Sidney's contact, however, turns out to be Mayor Mills, who forges some false phone records that indicate that David spoke to Kathryn last, even though the man claims to not have spoken to her that day. Emma is confused, because she was certain that David wasn't lying, but Sidney tells her not to beat herself over it, because David has lied before and is apparently good at it.

Sidney brings some flowers to the sheriff's station, claiming that they might help to brighten up the place. Emma asks him if he was able to find anything useful against Regina, but he says that he couldn't, because the Mayor is very good at covering up her tracks. However, he insists that he will continue digging for helpful info. Emma is later able to find a broken piece of a shovel in the site where the heart in a box was found, and the shovel in the Mayor's garage is a perfect match. However, when she shows up with a search warrant the following morning, the shovel has been replaced. Emma blames August for telling Regina, but she later learns that Sidney had planted a bug in the flowers that he brought her. Emma beats herself up for trusting the wrong people and apologizes to August.

Emma meets with Sidney, and she confronts him about the bug he used to spy on her to aid Regina. Emma accuses him of being in love with Regina, which would explain his loyalty to her. She gives him an ultimatum--he can either free himself from trouble by helping her or go down with Regina. Later, Mr. Gold watches August speed off on his motorcycle and follows him behind in his car. Regina meets Emma at the sheriff's station under the pretense of giving her a confession. Then she calls Sidney in, who goes into detail about everything because he had hoped he would get his job back by kidnapping Kathryn. Regina claims that Sidney has gone crazy. Emma doesn't buy his confession, but is forced to accept it anyway. When Jefferson sneaks into the psychiatric ward of the local hospital, in order to get to Belle, he walks past a room with a label reading "S. Glass", indicating that the reporter has been locked up in solitary.

Origins
The genie of the magic lamp is a supporting character in the story of "Aladdin", a Middle Eastern folk tale featured in The Book of One Thousand and One Nights (Arabian Nights), added to the collection by Antoine Galland. In the story, Aladdin is asked to retrieve a lamp from a booby-trapped magic cave by an evil sorcerer. When his mother rubs it, the genie appears, a very powerful jinn, who is bound to do the bidding of the person holding the lamp. With the aid of the genie of the lamp, Aladdin becomes rich and powerful and marries the Emperor's daughter. The genie builds Aladdin a wonderful palace – far more magnificent than that of the Emperor himself. The lamp is then stolen by the sorcerer, but in the end he is defeated and Aladdin and the princess live happily ever after. Disney released a film adaptation of the story, in which the Genie is presented as a goofy blue creature. In Once Upon a Time, the Genie also portrays the role of the creature inhabiting the Evil Queen's mirrors, from the story of "Snow White and the Seven Dwarfs", who serves as the Queen's confidant.