It is valid but highly illicit. There is some leeway granted on the words of absolution, i.e. the essential form is “I absolve you of your sins” but “I forgive you” will suffice. Still, in order not to cause confusion or scruples to people, the priest really ought to follow what is laid down. Be at peace, though, you were absolved.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.