The 23-year-old spent time at Fir Park from Dundee over the Christmas and New Year period when covering for the injured Gunnar Nielsen, Lee Hollis and Ross Stewart
He kept three clean sheets as Motherwell won all five of the games he played, prompting manager Stuart McCall to make his move when the keeper became available.
Twardzik told Well's official website: "I really enjoyed my time over Christmas and wished it could have been extended.
"It's a really good place to play your football; everyone at the club is so welcoming and the fans were superb with me.
"I really look forward to returning for pre-season, working with Gordon Marshall and hopefully pushing for a place in the starting 11 next season and beyond."
McCall said: "Dan came in on loan at short notice and performed terrifically well earlier in the season. It coincided with one of our best-ever runs.
"We always had it in mind to bring him in and we are delighted he has chosen to sign for us.
"He'll battle it out with the other goalkeepers at the club for that number one shirt."
Twardzik was born in Trinec in the Czech Republic, but has German nationality and played two games for their Under 18s.
Although he signed his contract with the club on Friday morning, the 23-year-old keeper will be officially registered next month.