The drugmaker Amgen Inc. has agreed to pay Massachusetts General Hospital $186 million to settle a dispute over royalties the hospital was paid for its role in helping develop Enbrel, a drug used to treat rheumatoid arthritis and psoriasis.

The one-time payment will free Amgen from obligations to pay future royalties from North American sales of Enbrel, the hospital said in a news release Tuesday after the settlement was reported in The Boston Globe.