NEW YORK - Diamond Offshore Drilling Inc, the second-largest oil and gas rig contractor, posted better-than-expected quarterly profit on Thursday, boosted by gains from its deepwater rigs.

Third-quarter net profit was $361.4 million, or $2.62 per share, up from $310.5 million, or $2.23 per share, a year earlier. Revenue rose 1 percent to $908.4 million.

Analysts on average had forecast earnings of $2.30 per share on revenue of $874.2 million, according to Thomson Reuters I/B/E/S.

The company also announced a special cash dividend of $1.875 per share.

Shares of Diamond Offshore are up 80 percent this year, compared with a 71 percent rise for the Philadelphia Stock Exchange oil service index .OSX. (Reporting by Matt Daily and Braden Reddall in San Francisco; editing by John Wallace)