It is estimated the new law could raise up to Â£1m a year for the Welsh NHS.
The bill's sponsor, Labour AM Mick Antoniw, said it would help people whose lives had been blighted by "this terrible disease".
The insurance industry has raised concerns, questioning whether the move is within the assembly's powers.
Before becoming an assembly member, Mr Antoniw was a solicitor at the legal firm which has acted for many asbestos victims and their families.
Speaking before the bill was passed, he said: "It is only right that medical costs incurred by the NHS should be recovered from those who caused the disease and used to give more support to asbestos victims and their families - for example, a cancer nurse costs Â£50,000 per annum.
"We could employ an additional 20 cancer nurses or a mixture of cancer nurses and counsellors or additional research into the cause and treatment of asbestos disease.
"It is my belief this new Welsh law can make a significant improvement to the quality of life of those whose life is blighted by this terrible disease."
Last December assembly Presiding Officer Rosemary Butler certified that the bill was within the institution's powers, but admitted it was a "finely balanced" decision on some aspects of the legislation.
The Association of British Insurers (ABI) wrote to her and the secretary of state for Wales with a number of what it called "serious concerns" about the bill's lawfulness.

Martin White, 45, of Belfast Road, Muckamore, County Antrim, was sentenced at Antrim Court on Friday.
It is understood this is the first prosecution of its kind in Northern Ireland.
The family of 67-year-old Ethna Walsh, who died in February 2014 said they hoped "hard lessons" would be learned from her "unnecessary" death.
The judge said Mrs Walsh's death had been caused by a "single momentary lapse of concentration" and was sentenced to four months in prison suspended for two years.
Mrs Walsh, a mother of seven, had gone to the Clear Pharmacy on Antrim's Station Road to pick up medication for lung disease, COPD.
White was supposed to give her Prednisolone, which is a steroid, but instead he picked up a box of Propranolol which slows down the heart.
Mrs Walsh took the pills she had been given at home but within minutes she had difficulty breathing and became unwell.
She was rushed to hospital in an ambulance but later died.
White told police that he must have given her the wrong drugs.
He said they were side by side on a shelf and had similar branding.
The court previously heard that before the death, White had complained of his "cramped working space" up to 20 times and had been to his GP about his low mood and tiredness.
An expert who investigated what had happened said accuracy checks should have been carried out but were not, and this had led to the tragic error.
However, the expert deemed that White was guilty only of "poor professional performance" as opposed to "professional misconduct".
The court heard that White had been earning more than Â£40,000 a year as a pharmacist but was now on benefits and "did not ever wish to return to being a pharmacist".
It was heard White had expressed "deep regret and sorrow" for Mrs Welsh's death and was receiving psychiatric help.
In a statement given to the BBC, Mrs Walsh's family described her as their "bedrock and centre", adding that she was the "beating heart of her family".
The statement continued: "That her death was due to a series of entirely avoidable errors makes this matter all the more difficult.
"We welcome today's resolution of the criminal proceedings arising from the death and acknowledge the admission of culpability and guilt on the part of Mr White."
The family said that following Mrs Welsh's death, recommendations had been been made to pharmacists regarding dispensing errors.
The statement concluded: "The family of Ethna Walsh hope that other families will be spared the burden of pain, anguish and loss they have had to shoulder and commend, to all community pharmacists, the hard lessons from this unnecessary death."
A bill to recover the costs of treating Welsh asbestos patients from businesses or insurers has been passed by assembly members.
[NEXT_CONCEPT]
A pharmacist has been given a suspended sentence for supplying the wrong drugs to a grandmother of 15 who later died.