Any advice on this?

It's a cash game, NL, blinds 1 and 2. I'm on the button with about $150 and raise to 4xbb with A9 offsuit, not a great hand but worth a position raise I felt. Two players call.

Flop comes A 8 6, two hearts, one diamond. It is cheked to me. I have top pair but am wary of my kicker, although I suspect that anyone with a higher kicker would have raised or maybe even reraised pre-flop. To find out where I am and as I don't want anyone drawing cheap, I make a pot sized bet. One player calls (he has about $230) the other folds. I suspect the caller (who I have noted as a fairly solid player but who like to see flops and can be loose occasionally) is drawing to a heart flush, a straight (although I dismiss this as he called a pre-flop raise), has an A with a smaller kicker or maybe second pair. I am fairly certain I'm in front.

Turn brings the T of diamonds. Caller checks to me and I make a pot sized bet. Caller calls.

River is 7 of diamonds. Caller moves all-in. I can't put him on a flush as he called the flop with one diamond (unless he has the A and a smaller diamond). I figure that the straight I have made is very likely to be in front and so I call.

He turns over K8 of diamonds and I have lost my stack. He called pot sized bets with second pair and a three-flush on the flop and second pair and a four flush on the turn. I can understand the latter call but not the former.

Where did I go wrong? Was I incorrect to call? I knew a flush was a possibility but couldn't persuade myself that he had it. Or is this just a bad beat or poor play by an opponent who got lucky?

Any comments welcome - I'm still learning!