The 27-year-old joins Boro after spending the last decade at Blackburn Rovers, where he was captain last season.
A versatile centre-back with 260 career appearances Lenihan brings a wealth of experience to Boro.
Chris Wilder said: “I've been a huge admirer of Darragh for a long time, in terms of his qualities he brings as a player, as a person, as a competitor, as a warrior, and a leader of men.
“I'm putting a bit on him but I know he can handle it. He's a proper football player and I'm delighted.”
Lenihan is the club’s third signing of the week following the double capture Ryan Giles and Liam Roberts.
Lenihan made made 43 appearances for Tony Mowbray’s side last season, captaining Rovers to eighth in the Championship table and narrowly missing out on the play-offs.
Rovers’ director of football Gregg Broughton had earlier hinted Lenihan would exit the club after reports elsewhere had suggested the defender had made his intentions clear.
“I haven’t had a chance to speak to Darragh myself, but the information I got when I came was very clear that he’d already made that decision and communicated that with the club,” Broughton told the Lancashire Telegraph.
“Darragh has been a great servant, he’d come through the academy, been here many, many years, and sometimes a player says that’s his time to go and have a look elsewhere, and sometimes in life you have to experience something different.”