The Massachusetts legislature passed a first-in-the-nation bill on Tuesday that seeks to limit the growth of health care costs in the state.

The bill would not allow spending on health care to grow any faster than the state’s economy through 2017. For five years after that, any rise in health care costs would need to be half a percentage point lower than the increase in the state’s gross domestic product.

Legislative leaders say the bill, which includes other cost-slowing provisions, could save as much as $200 billion in health care spending over the next 15 years.

Although Massachusetts, under Gov. Mitt Romney, in 2006 became the first state to require most residents to have health insurance — the model for President Obama’s national health care overhaul — the law did little to slow health care costs that were already among the highest in the nation. Such spending has increased by 6 percent or 7 percent a year recently, compared with annual state economic growth of less than 4 percent.