Showtime has ordered a second season of “The Affair” and a fifth season of “Homeland.”

The moves were expected but nonetheless a vote of confidence in the pay cabler’s buzzy freshman drama, and a sign that “Homeland” is back on strong footing after some struggles in its third season.

“Affair” (pictured) has a 10-episode order for 2015. “Homeland,” from 20th Century Fox TV’s Fox 21 unit, is picked up for 12 episodes.

“In its fourth season, ‘Homeland’ has brilliantly reinvented itself. It continues to capture the attention of a devoted fan base, and has provided an enviable platform for the successful launch of ‘The Affair,’ ” said Showtime Networks prexy David Nevins. “With thought-provoking, relevant and addictive storylines, both series have been embraced, dissected and much debated week after week. We’re excited to see more from these complex shows in 2015.”

“Affair” bowed last month to critical raves. Series led by Dominic West, Ruth Wilson and Maura Tierney examines the unfolding of an extramarital affair from the male and female perspectives. Sarah Treem and Hagai Levi co-created the show and exec producer with director Jeffrey Reiner and Eric Overmyer.