Williams was one of a group of players targeted by big-spending French clubs, with Beziers and Castres thought to be keen on securing his services.
He has starred for Wales since regaining his place at the World Cup, showing dazzling form in the games against New Zealand and England.
Hooker Barry Williams has also signed a new three-year deal with the region.
‘I’m a very happy man,’ said Ospreys chief executive Mike Cuddy after securing Shane Williams’ signature.
Williams said he was flattered by the French offers, but delighted to sign back on with the Ospreys.
‘I’m literally over the moon to be staying on with the Ospreys,’ said the 27-year-old wing, who has won 18 caps and scored 15 tries for his country.
‘Whilst, of course, it’s extremely flattering to receive the sort of offer I did from France, it was not something I ever seriously considered.
‘I’m settled here in Wales, playing rugby here in Wales and I’m staying here in Wales.
‘This is a very exciting time to be at the Ospreys, the club is really coming into its own and I’m loving every minute of playing rugby here.
‘The club has made huge progress since the start of the season, particularly in terms of the structures and professionalism.
‘I’m conscious also that my personal level of rugby is consistently rising, the level of rugby in Wales is rising and, as we’ve seen, the level of the national team is rising.’