Violent computer games will now be subject to R18+ ratings in NSW to protect young people from harmful and disturbing material.

The new laws, passed in the NSW Parliament last night, make it an offence to sell an R18+ computer game to a minor.

This is in line with the federal government's move to introduce a national regime to make classification rules for computer games and film the same.

"This is a victory for adult gamers and a victory for parents who want to protect their children from computer games with unsuitable content," the state's Attorney-General Greg Smith said after the bill was passed.

He said the new R18+ rating would prevent violent games from being classified as MA15+ by default because the R18+ category did not exist in Australia.