Cornish Pirates continued their unbeaten record in the Championship play-offs as they overcame a battling Rotherham side at Clifton Lane.
Four Rob Cook penalties gave the Pirates a 12-6 lead at the break, Juan Pablo Socino scoring for Rotherham.
The Pirates extended their advantage with second-half touchdowns from Dave Ward and Phil Burgess.
Rotherham kept fighting and were rewarded with an injury-time try from Clifford Hodgson.
The Pirates now head up Pool B of the promotion play-offs with 20 points, while Bedford Blues are second on 14 points.
The Blues lost 33-31 against Doncaster Knights, who are third on 12 points, while Rotherham are bottom having picked up one point.
All four teams have two matches left to play, with the top two then progressing into the semi-finals.
POST MATCH REACTION
Cornish Pirates high performance manager Chris Stirling told BBC Radio Cornwall: "Rotherham really took it to us today on their home patch and they played the style of rugby that they're good at and really made us work hard.
"We were our own worst enemies at times, but we showed composure when it counted and took our opportunities in the second-half.
"What we've got to do next week is go out and grab the points to cement our place in the semi-finals and play well and take it to Bedford."