Government Services Minister Stuart Robert has defended the government's handling of its controversial welfare debt recovery system after internal emails revealed the Department of Social Services was told the so-called 'robodebt' scheme was illegal.

The emails between senior bureaucrats, released to a Senate inquiry on Thursday, reveal discussions from late November on the day the system was scaled back and show the Australian Taxation Office advised the department the scheme was "unlawful".

Government Services Minister Stuart Robert has defended his department's handling of robodebt. Credit:Alex Ellinghausen

"[The Department of Social Services] have received legal advice that debts based solely upon DSS own income averaging of ATO annual tax data are not lawful debts ('robo-debts')," read the November 19 email from ATO general counsel Jonathan Todd to ATO commissioner Chris Jordan, marked 'Sensitive: Legal'.

"They have also suspended the raising and recovery of robo-debts as of today."