Dog welfare advocates and a tiny poodle called Oscar are celebrating after law reforms to ban the practice of puppy farming passed Victorian parliament.

The number of dogs that breeders are allowed to keep will be limited after a bill, championed by welfare group Oscar’s Law, passed on Friday in a tight upper house vote. It also means pet shops will no longer be allowed to sell puppies.

“Today’s an incredible victory,” Oscar’s Law founder Debra Tranter told reporters in Melbourne.

“For the first time anywhere in Australia we’ve got a cap on the number of dogs that puppy farms are allowed to keep.

“It’s the end of the days where we see literally hundreds of dogs lined up in sheds, pumping out puppies for the pet market.”

Tranter said pet shops will now become adoption centres for rescue dogs, who will benefit from the changes.

From April 2020 breeders will be able to keep a maximum of 50 fertile female dogs.

Breeders with more than 10 female dogs will have to seek ministerial approval and will be subject to stricter regulations.

Oscar’s Law advocates gathered at Victoria’s Parliament House with their furry companions and cried tears of joy after the successful vote.

The group is named after Tranter’s toy poodle, Oscar, who was a stud dog at a puppy factory before being rescued.

“He inspired the campaign,” Tranter said, cradling the tiny 11-year-old dog.

“He spent the first five years of his life in a shed, supplying puppies for pet shops.”

Under the reforms, anyone selling a pet must also provide a registered source number to show where the animal was bred.

“If we don’t know where a kitten or pup was bred, we can’t possibly know what conditions they or their mum have been living in,” RSPCA chief executive Liz Walker said in a statement, welcoming the laws.