The scrum-half’s long-term future will now be with the capital region.
Williams revealed his ambition to play for Wales means he turned down options elsewhere.
“My ambition is still to play for Wales, that’s a goal of mine,” said the 28-year-old, who also has 28 caps for his country.
“Obviously this new 60-cap law has come in. You always have to keep your options open and if that rule hadn’t come in, I am sure there could have been other things to take into account.
“But it has come in. They are pretty set on it to try and keep all the best players in Wales.
“There were other options, but it wasn’t really too far down the line with any of them.
“I was speaking to a few others, but I wanted to remain in Wales. And it was always the case that if I was staying in Wales, I would want to stay here at the Cardiff Blues.
“There were a lot of things coming into it, but first and foremost it was about trying to stay at the club.”
Williams’ sublime kick – when playing on the wing – set-up a crucial try for Gareth Davies as Wales claimed a famous pool stage win over England at the 2015 Rugby World Cup.
On his future with the Blues, Williams added: “I have got a lot of people I trust and rate very highly here. I have got some of my best mates alongside me.
“When I took a step back and thought that, things kicked on a bit quicker then. We have had our ups and downs, but that’s part and parcel of professional rugby.
“There have been a few stumbling blocks along the way, but we are going to try and push things on in years to come. I feel there is a lot of optimism around the club.
“We have got a great crop of youngsters coming through, which is really good. It’s the capital region, it’s brilliantly located, and the most important thing is the people in the building.
“I really want to kick on here now. I want to look towards the future and have a real good rest of the season.”