Australian lawmakers have voted to legalize marijuana in the country's capital city Canberra and its surrounding jurisdiction.

Laws passed in the Australian Capital Territory (ACT) Legislative Assembly on Wednesday will permit the possession, use and cultivation of small amounts of cannabis in the ACT, where the city of Canberra is located.

The ACT is the first state or territory in Australia to legalize the drug.

Under the new legislation, adults over the age of 18 will be allowed to possess of up to 50 grams of marijuana, with every household permitted to cultivate up to four cannabis plants.

Marijuana will be banned from being used near children, with the legislation also barring it from being grown in communal gardens.

The laws will come into effect on January 31, 2020.

However, the bill conflicts with Commonwealth law — Australian federal law — under which the drug is still illegal. Lawmakers pointed out that because of this, prosecution for cannabis use or possession may still be possible.

ACT Attorney General Gordon Ramsay said Wednesday that the new legislation did not entirely remove the risk of arrests, according to Australia's public broadcaster the ABC.

"Unfortunately (this law) cannot stop someone being arrested and charged if the Commonwealth officials were minded to do so, or prosecuted if the Commonwealth Director of Public Prosecutions thought it were appropriate to do so," he reportedly told lawmakers.