Former WWE star X-Pac tells TMZ ... he lost so much blood after tearing his anus apart during a wrestling match in Minneapolis last weekend ... he nearly died.

Pac -- real name Sean Waltman -- says he didn't notice the blood at first ... and even finished the match ... but during the after-party he felt something was really wrong. Pac says he went to the bathroom and discovered an enormous pool of blood in his singlet.