Javier Esposito is a fictional character portrayed by Jon Huertas in the ABC crime series Castle.
Esposito is a bilingual (English and Spanish) detective who works in the homeside division with his partner Kevin Ryan, as part of Beckett's team. He is always ready with a sardonic comment to keep Beckett on her toes and enjoys the way Castle riles her up. He and Ryan are best friends, even though they constantly argue about obscure facts. He is dissapointed when Ryan felt obligated to ask his fiance's brother to be his best man instead of him. It is implied in the pilot 'Flowers for Your Grave' he is a fan of Shark Week, and in the season 2 episode "Den of Thieves," it is revealed that Esposito transferred out of the 54th Precinct and has been partnered with Ryan for 3 years prior to the pilot episode. In season 3's "Poof, You're Dead," he and medical examiner Lanie Parish began a relationship they believed was a secret. However, their relationship was common knowledge to the other characters, who were playing along out of respect for their privacy, and in the episode "Lucky Stiff," Ryan tells Esposito that everyone knows about the relationship. In the season 4 episode, "Demons", Esposito reveals that he and Lanie are "taking a break" after an awkward incident on a double date . In "Almost Famous", it is implied that he was in the Green Berets; this point of Esposito's personal history is developed in subsequent episodes "Knockdown" and the two-episode arc "Set-Up" and "Countdown." In the episode "Kill Shot" he displays technical knowledge of military sniping and references serving in a sniper unit, heavily implying that he received training.
In the season four finale, 'Always', Esposito stands firmly behind Beckett as she decides to pursue the investigation of her mother's murder in secret because they fear that there would be other dirty cops in the Precinct. This leads him to quarrel with Ryan who believes that they should come clean. After fighting with Maddox on the roof of a building, Beckett is saved by Ryan and Gates whom he had warned. Back at the Precinct, Gates suspends Beckett and Esposito for their actions. Beckett then resigns and Esposito refuses to talk to Ryan, just walking away as he tries to explain. Their friendship, however, is quickly renewed in Season 5.