Massachusetts police chiefs would have the right to go to court to deny firearms identification cards needed to buy rifles or shotguns to individuals they feel are unsuitable under a compromise bill released by lawmakers.

The bill, expected to come up for a final vote Thursday, is a compromise between House and Senate versions of a sweeping overhaul of the state's gun laws.

The House version gave police chiefs discretion on issuing FID cards. The Senate stripped out that provision.

Under the compromise, police chiefs would have 90 days ask a court to deny an FID card if they feel the recipient is unsuitable.

The bill would also create a Web-based portal to allow real-time background checks in private gun sales and mandate Massachusetts join the National Instant Background Check System.