South Australian Greens senator Sarah Hanson-Young has accused counterpart David Leyonhjelm of telling her during a debate in Parliament to "stop shagging men".

The Senate was debating a motion put forward by crossbencher Fraser Anning to relax importation restrictions on pepper sprays, to allow women to better protect themselves.

It was then that the senator accuses the Liberal Democrat of launching the tirade.

"I walked over to the senator and confronted him directly," Senator Hanson-Young told the Upper House.

"I asked whether I heard him correctly.

"He confirmed he had yelled, 'you should stop shagging men, Sarah'."

The South Australian retaliated.

"Shocked, I told him that he was a creep," Senator Hanson-Young said.

"His reply was to tell me to f-dot-dot-dot off."

Senator Leyonhjelm did not deny the altercation when contacted by the ABC.

"Greens senator Sarah Hanson-Young interjected, saying something along the lines of all men being rapists," he said in a statement.

"I responded by suggesting that if this was the case she should stop shagging men.

"I did not yell at her."

He said he would not be withdrawing his remarks.

"I do not agree with Senator Hanson-Young's sentiments about all men being rapists and I believe I have the right to voice my opinion accordingly," Senator Leyonhjelm said.

"That Senator Hanson-Young took offence from my comments is an issue for her, not me.

"However, I am prepared to rephrase my comments. I strongly urge Senator Hanson-Young to continue shagging men as she pleases."

In debating the motion, the Coalition said it had no intention of changing the importation rules for pepper sprays, and the Greens accused Senator Anning of trivialising women's safety.

"The last thing that women in Australia need now is another man in power telling us that we are responsible for violence against us," Senator Janet Rice said.

"Senator Anning's motion put the onus on women to go to extreme lengths to ensure our safety, where the priority must be to eradicate men's violence."

Labor also opposed changes to the rules, and the motion was defeated 46 votes to 5.