NEW YORK – Cellphone companies pledged Monday to warn subscribers before they go over their monthly limits for calling minutes, text messages and data use.

The pledge comes in response to a threat of regulation by the Federal Communications Commission, which wants to curb nasty surprises in the monthly bills of wireless subscribers.

CTIA — The Wireless Association, a trade group representing the major cellphone companies, said they’re also promising to warn subscribers that they’re paying roaming fees if they travel abroad.

The warnings will arrive as text messages, and they’ll arrive automatically. CTIA said its members will have warnings in place on at least half their plans in a year and all of them in two years.

AT&T and Verizon Wireless, the two largest carriers, already provide text-message warnings on their data plans, but not on text messaging or calls. Instead, subscribers must look up their usage data.

The announcement was made jointly by the CTIA and the FCC, which credited Consumer’s Union, the publisher of Consumer Reports magazine, for raising awareness of the issue.

Curbing occasional high bills is unlikely to have much of a financial effect at phone companies because of the trend over the past few years of making calls to other cellphones “free,” or not counting toward the plan limits.