Moeen Ali has admitted given the choice he would rather have missed out on his maiden Test century and saved the second Investec Test with Sri Lanka at Headingley.

The Worcestershire all-rounder batted all of the final day and scored a brilliant 108 not out in a rearguard action by England.

But last man James Anderson was dismissed by the penultimate ball of the game as Sri Lanka won a Test series in this country for the first time.

Ali said: "I'm gutted. A 100 to save the game would have been fantastic but it doesn't mean so much with the guys being so disappointed (at losing).

"I was up for it but unfortunately we just couldn't make it as a team. I'd much rather have got 99 and saved the game.

"Jimmy played fantastically and it was a brilliant ball at the end to dismiss him, right on the money.

"It was just one of those things. I was gutted for him and the lads."

Ali was determined to make up for a loose shot which led to his dismissal for two in the first innings.

He was also concious of trying to help the team obtain a draw rather than reaching his own maiden century for his country and often refused easy runs to keep the strike.

He said: "I was really disappointed with the way I got out in the first innings and I just wanted to bat as long as I could.

"I had to fight myself a little bit. There were times when it (the possibility of a 100) did come in but I stopped myself and said 'if it happens, it happens.'

"I wasn't keeping an eye on the scoreboard until I got to 96. There is a guy on your shoulder who just wants you have a go (to get there)! I tried to rein it in.

"There were a couple of losse shots but I tried to rein it in and just let it happen."

When asked if the century proved that he belonged at Test level, Ali, in an interview with Sky Sports, said: "The way I approach my cricket, I've got enough confidence.

"It is just about doing the right thing every day.

"But sometimes you just want to prove to yourself that you can do it. I just wanted to bat as long as I could on the last day."

England skipper Alastair Cook and head coach Peter Moores praised the efforts of Ali.

Cook said: "Moeen played an outstanding innings. For a guy in his second Test to play like that and get a 100 like that bodes incredibly well for the future.

"We knew his class. You never know how a guy is going to adapt to international cricket but the way he handled himself the last two games, having the confidence at Lord's to hit almost his first ball over the top, that kind of stuff, shows what he is about.

"He is a brave cricketer and the way he constructed that innings, the way he worked in the partnerships, you couldn't fault and he didn't deserve to be on the losing side."

Former Worcestershire wicket-keeper Moores said: "That is as good a Test knock as you will see given the situation, how calm he was, how he tried to shepherd and talk to the lower order when they came in.

"He just looked every bit as if he had been there for a long time. In his second Test, it was a great effort."