The Librarian: Return to King Solomon's Mines is the second in The Librarian franchise of movies starring Noah Wyle as a librarian who protects a secret collection of artifacts. Gabrielle Anwar, Bob Newhart, Jane Curtin and Olympia Dukakis co-star. It is a sequel to 2004's The Librarian: Quest for the Spear. The third film in the trilogy, The Librarian: Curse of the Judas Chalice, was released in 2008.
Flynn Carsen (Noah Wyle), a year after his first mission as the Librarian, has been on many more death-defying missions to protect the world from evildoers, including a trip to Utah to recover a mystical crystal skull. Upon his return to the Library, the audience is introduced to more mythic artifacts stored there: The Head of Medusa, the Trident of Poseidon, the Shroud of Turin, and the Pipes of Pan. He has moved out of his mother's house into his own apartment, but still feels held back by Judson, his supervisor, who tells him that "sometimes you have to give up what you want for the greater good" in order to go from being a "good librarian" to a "great librarian".
Meanwhile, at Flynn's birthday party, his late father's friend, "Uncle" Jerry (Robert Foxworth), tells Flynn about how Flynn's dad courted his mother. Flynn remembers the "silly bedtime stories" and the amulet his father had, which his mother says came from a secondhand shop. When Flynn goes home, he discovers that someone has trashed his apartment; he is ambushed and robbed of a scroll he received in the mail that day. It transpires that the scroll is a map containing clues to the location of King Solomon's Mines. Flynn, in typical high-adventure fashion, cannot allow the thief to find the rest of the clues and thus, the mines themselves. Judson (Bob Newhart) tells him that possession of the Book of Solomon, hidden in the mines, will give the reader of it control over time and space, so that the secret must be kept hidden.
Flynn is en route to Morocco, to find part of the key to the scroll among some Roman ruins, where he meets Emily Davenport (Gabrielle Anwar), an archaeologist who, as it turns out, holds 3 more degrees than Flynn and can argue convincingly about ancient history, Biblical texts, and geography. Flynn and Emily are attacked after finding the piece to the map legend and discovering a hidden meaning to the amulet, which links him to the brotherhood of the Masons, one of whose members helps them escape and tells them where to find the remaining part of the map legend. Emily, recognizing the code on Flynn's piece as being in the Akon language, insists on coming with Flynn to Gede Province in Kenya. The men who attacked Flynn, led by a General Samir, turn out to be on the trail of the mines as well. They torture the man who helped Flynn escape until he tells them where Flynn was headed.
After a ride on a honeymoon tour bus—where Flynn runs into Debra (Lisa Brenner), a former blind date, with her husband Carl (Jonathan Frakes), who reports their meeting back to Flynn's mother, with disastrous results—and several days' hiking across the Serengeti, Flynn and Emily literally stumble across a man buried up to his neck in sand as punishment for stealing a neighboring tribe's crops. The two adventurers dig him out; he insists on being their guide in return. Flynn shows Emily the drawings he made as a child to accompany his father's "silly bedtime stories", his mother having slipped them into his bag. They show scenes of laughing rocks, upside-down valleys, and other fanciful places. Emily, in turn, confides to Flynn her obsession since childhood with the mysterious Queen of Sheba, wife of Solomon. After several more days of hiking, they finally reach a village. There, as their guide Jomo (Hakeem Kae-Kazim) tells them, a fortune teller can help them. Unknown to them, the fortune teller's shop has been appropriated by the men chasing them. Just as Flynn finds the other piece of the map legend there, Emily sees the enemy coming and they flee.
To their amazement, they run into Flynn's Uncle Jerry, who is in Kenya to pick up some stock for his import-export business, and he hustles them aboard a train on which he has reserved some space. Jerry feeds the pair, gives Emily a skimpy Maasai dress, and quizzes Flynn about his "secret life", while Flynn in turn shows Jerry the amulet his father left him. After dinner, Flynn checks Emily's cabin to find her tipsily analyzing the Akon code. It turns out to have a connection with the Biblical Song of Solomon, which leads to a romantic interlude. This is unfortunately ruined when the two argue over the translation of the love poetry. Next morning, Flynn and Emily, having solved the code, travel to Three Witches Mountain near Mombasa, and find that the terrain reminds Flynn of his juvenile drawings. Eventually he realizes that his own father must have known about the mines' location and told Flynn stories to plant clues in his memory, giving him the amulet in case he ever needed to guard the secret and enlist the help of other Masons. With the antagonists in pursuit, the two manage to penetrate the caves where Solomon's treasure is hidden. Gold, jewels, and other treasures litter the caverns; a huge head of Queen Sheba, carved out of the stone wall, looms over all. Flynn spots a book resting on a pedestal, opens it, and realizes that this is the book of which Judson told him. As he glances through it, the text seems to be attracted to his hand, beginning to glow in a sinister fashion.
Their pursuers come upon them and drag in a disheveled Uncle Jerry, who begs them to give General Samir the book in exchange for his own life. Flynn complies, only to find that the General and his thugs work for Uncle Jerry, who wants to turn back time so he can fulfill what he thinks was his destiny; to win Margie Carsen (Olympia Dukakis), who he feels was stolen from him by Flynn's dad. It turns out Jerry is the unknown figure who shot Flynn's father, after Carsen refused to tell Jerry about the mines. As Jerry enters a cave filled with hundreds of mummified bodies and a bubbling lava pit, he begins to read aloud the incantation that will give him power over space and time, stirring up ghosts as he does so. Flynn and Emily are flung into a pit, which fills with water and features a slowly descending, spike-laden ceiling. After Flynn experiences a vision of Judson on a white beach, he finds that he and Emily are being rescued by the faithful Jomo, who has followed them to fulfill his life debt.
Flynn confronts Jerry over the book, wrestling it from him with the incantation unfinished. As Flynn is about to throw the book into the lava pit, he begins to see visions of his father in the pit. Jerry seizes the chance to try to convince Flynn that they can change time together. Flynn begins to finish the incantation. Emily and Jomo burst into the cave to find Flynn uttering the incantation and an army of ghosts circling the cave. Emily uses a reflective spear to shine light on Flynn's amulet, which catches his attention and reminds him of his father's trust. When Flynn throws the book into the lava pit, Jerry jumps after it and falls into the lava as Flynn, Emily, and Jomo flee. As the cave crumbles, the evildoers are crushed by falling rock.
In a brief epilogue, Flynn assumes Emily will be coming back to New York with him, but she decides to pursue her search for the Queen of Sheba in Tunisia, leaving Flynn with only fond memories. In a scene reminiscent of Casablanca, Flynn, in a trench coat and fedora, wanders toward his plane, musing, "Of all the gin joints in all the world, she had to walk into mine."
Flynn returns to the library and tells Judson that he threw the book into the lava which he believes was "not very librarian" of him. Judson reminds him that by giving up the chance of seeing his father by destroying the book, he sacrificed what he wanted "for the greater good", and was now a "great librarian". When Flynn asks Judson why he did not tell him about his father's connection with this journey, Judson explains that it was a lesson Flynn had to learn on his own, and Judson is sure that wherever Flynn's father is, he is proud of his son. The film ends with a humorous discussion about Flynn's vision of Judson on a beach back at the mines.