The 38-year-old, who scored 1,493 runs from 55 T20 international appearances, will play in 12 of Somerset's scheduled 14 matches.
"When a player of his experience and class becomes available, you have to snap them up," director of cricket Matt Maynard told the club's official website.
"Mahela is a batsman of undoubted class who scores his runs all around the wicket. He is a true professional and will have a major influence both on and off the field for us."
The veteran batsman added: "The club has a tradition of successful overseas players and I will be doing my best to join that illustrious list."
Jayawardene will join Chris Gayle at the County Ground, which means that Somerset will have the ICC World T20's two highest run-scorers in history within their ranks.