The group of migrants were brought ashore by the Sri Lankan navy and were handed over to the police at the southern port of Galle.
Four persons were from the minority Tamil ethnic group while rest 37 were Sinhalese including children, police spokesman Ajith Rohana said.
The police said the asylum-seekers would be charged with leaving the country illegally and any found guilty would face imprisonment.
Leaving the country illegally is a criminal offence punishable with up to two years in jail.
More From This Section
Following the controversial mid-sea transfer, the UNHCR has criticised Australia and said it breached international commitments by attempting to deport the Sri Lankan asylum seekers.
The transfer of the illegal immigrants yesterday comes ahead of the Australian Immigration Minister Scott Morrison's Sri Lanka visit later this week.
Australia has put in a major effort to stop Sri Lankan asylum seekers arriving by boat.
They have equipped the Sri Lankan navy with surveillance craft to detect illegal travellers on board fishing trawlers in addition to running media campaign to deter people from joining immigration scams.