YORK, Maine (CBS) – Lifeguards at a popular Maine beach rescued two Massachusetts brothers who were swept out to sea while swimming in waist-deep water.

The brothers, 10 and 14 years old, were swimming at Short Sands in York on Monday. The Massachusetts residents were near the rocks where the waves, which were about seven feet high, collect.

READ MORE: Market Basket 'Stole The Number 3 Position From Trader Joe's' In New Grocery Retailer Rankings

Just as lifeguards were about to call the boys in from the waist-deep water, they were pulled out to sea by the current.

The York Recreation Department said it was not a rip tide that pulled the boys away from the beach.

READ MORE: Happy 20th Birthday To The Snow Bowl -- Or The Tuck Rule Game, Depending On Your Perspective

The two lifeguards, Adam Legg and Brad Taillon, rushed into the water.

After diving into the water, the lifeguards pulled the boys onto the nearby rocks about 40 yards from shore.

Both brothers were transported to a nearby hospital. A recreation official said the boys were cold, but otherwise in good health.

MORE NEWS: NH Bar Employee Halts 'Dangerous And Frightening Situation' By Tackling Man With Gun

The lifeguards suffered cuts during the rescue.