Ospreys have announced that they have reached an agreement with Shane Williams that will see the winger retire from rugby at the end of the current season in May.
The 34-year-old's contract was due expire at the end of next season.
Williams, who retired from international rugby in December, will then take up an ambassadorial role with the club until 2014.
"My future with the Ospreys was never in doubt," Williams told the club's official website. "Things like this take time to sort out but I'm just delighted that I'm going to continue being a part of the region I love, the Ospreys."
Wales's all-time leading try scorer joined the club in 2003.