How much debt are we talking? Could you write a check and pay it all off tomorrow?
If you will ACTUALLY diligently invest the money, might be best to keep the loan and pay off at the proscribed rate. As has been pointed out, you can get a tax break on the interest, there is the possibility of a forgiveness program coming into play, etc. 2.8% is really low interest.
However, if it's a relatively small amount of $$, you might want to go ahead and pay it off, just to get the monkey off your back, so to speak.
I paid, in total, around $12k in loans for university. I took what I would consider a semi-aggressive stance in paying them off--I made sure I was building up savings and investing, but I always chucked a bit of extra $$ into my monthly payments. If I received extra $$ unexpectedly, I always directed some of that to the loan repayment. I had the whole thing paid off within 4 years of graduation, which is not an insanely fast rate, but is much faster than I was "supposed" to pay it off. I always made sure I had some cushion of savings, in case a huge unexpected expense came along--I didn't want to get stuck with a high-interest CC debt just because I had been so good about paying off my low interest education debt.