New York’s attorney general notified Comcast Corp. on Monday that the state will take legal action if the company — the nation’s second-largest Internet service provider — doesn’t agree to eliminate access to child pornography.

Attorney General Andrew Cuomo wants major Internet access providers to agree on steps to remove certain newsgroups that contain child pornography and purge their servers of Web sites that contain child porn.