CLEVELAND -- Cleveland Indians starting pitcher Josh Tomlin was pulled from the rotation at the end of August after a rough month of outings, but the veteran right-hander seems to have found his rhythm in the nick of time.

Tomlin spread out six hits and two earned runs over 7.1 innings of work in a 3-2 win over the Kansas City Royals at Kauffman Stadium Sunday, a victory that helped the Indians lock up home-field advantage against the Boston Red Sox in the American League Division Series, which gets underway at Progressive Field Thursday.

“It feels good to be able to help this team contribute and help this team win,” Tomlin said. “In August, I had a bad month, but I just had to stick with it, talk to people and figure out what I was doing, and hopefully, correct it. It’s been pretty good so far.”

After being reinserted into the starting rotation following a rash of injuries, Tomlin won two of his four starts and had one no-decision over 25.2 innings of work against the Royals and Chicago White Sox.

Tomlin allowed just five earned runs, one home run and no walks with 10 strikeouts over those four starts.

“He’s a tough kid,” Indians manager Terry Francona said. “We all know that. I think we thought missing a start or two would do him some good. Being the competitor he is, he didn’t want to. We really respect that, but when it came down to it, he was able to almost hit the refresh button.

“Even mentally, just thinking some things through I think was really good for him. He deserves a ton of credit though because he got after it not just with his pitching, but trying to understand what was going the wrong way, and he’s been good since he’s come back.”

Indians catcher Yan Gomes added, “He did amazing. It should be an incredible confidence booster for him and for us going into the playoffs. Having him as either a Game 3 (starter) or whatever, being able to pitch for us, we’re excited he’s bouncing back.”

In six August starts, Tomlin posted an 0-5 record with an 11.48 earned run average. Despite striking out 21 hitters against just six walks allowed over 26.2 innings of work, Tomlin surrendered 46 hits, including a team-high 10 home runs, as well as 35 runs, 34 of which were earned, in those August outings.

Tomlin made it out of the fifth inning in just one of those six starts.

Entering September, Tomlin was 11-8 with a 4.89 ERA in his 25 starts. Over 147.1 innings of work prior to the change in the rotation, Tomlin allowed 166 hits, 80 earned runs and a team-high 35 home runs despite having a better than 5-1 strikeout-to-walk ratio.

Tomlin carried a stellar 11-3 record and 3.43 ERA into August.

“To know that I was still feeling good throughout that month, I just wasn’t getting the results, was still something that I was happy about,” Tomlin said.

“Obviously, you don’t want to pitch the way I pitched in August, but to be able to feel healthy and to know that if I make the adjustment, I could come out of it was huge. That’s what I kept doing. I knew I felt great, so I was going to keep grinding it out, seeing what I was doing and trying to make the adjustment.”