
504 So.2d 1185 (1987)
LESTER ENGINEERING COMPANY, INC.
v.
RICHLAND WATER AND SEWER DISTRICT.
No. 56190.
Supreme Court of Mississippi.
February 11, 1987.
Rehearing Denied April 22, 1987.
E. Clark Rumfelt, Wells, Wells, Marble & Hurst, Jackson, for appellant.
Paul B. Henderson, Brandon, Pat H. Scanlon, Young, Scanlon & Sessums, Jackson and Brandon, for appellee.
Before WALKER, C.J., and DAN M. LEE and GRIFFIN, JJ.
DAN M. LEE, Justice, for the Court:
This cause was originally filed in the Circuit Court of Rankin County by Lester Engineering, seeking indemnification for expenses incurred as the result of successfully *1186 defending a negligence suit brought by a third party. The trial court dismissed the suit on a motion to dismiss for failure to state a claim, but allowed Lester to amend its complaint. Lester amended its complaint; however, the trial court ultimately granted Richland's motion for summary judgment. Lester appeals both the 12(b)(6) dismissal and the granting of the defendant's motion for summary judgment. Finding error therein, we reverse and remand this cause.
In 1968, Lester Engineering and the Richland Sewer District entered into an agreement whereby Lester was to perform professional services for Richland in conjunction with the development of a sewage collection, transport, treatment and disposal system. The Agreement provided that Lester would serve as Richland's professional respresentative on the project and would be responsible for the technical design of the work and general observation of its quality. In addition to reimbursement for these technical services, the Agreement also called for reimbursement of "Special Engineering Services," ("engineering services performed in connection with litigation and negotiation"); "Special Project Administrative Services," ("miscellaneous services, not of an engineering nature, but connected with the work and accomplished for the convenience of the OWNER"); and "Related Services," ("those services of a highly technical and specialized nature ... or other services of a non-professional or non-technical nature necessary for the proper accomplishment of the work").
The services performed by Lester for Richland eventually culminated in a contract, dated 1976, for the construction of the sewage system. The contract was authored by Lester Engineering. Lester was not a party to the contract, but was named therein as "the Owner's professional representative in all phases of the work... ." This contract and the 1968 Agreement are the basis for this suit.
After construction of the sewage system began, problems developed with some of the pipe that had been laid. Armco, Inc., the pipe manufacturer, eventually volunteered approximately $1.6 million to repair the allegedly defective pipe. However, in 1980, Armco filed suit against Lester and two of the contractors on the project. The suit charged Lester with negligence in preparing plans for the system, in administering contracts, and in inspecting, approving, and certifying work. The United States District Court for the Southern District of Mississippi issued summary judgment on behalf of Lester and the other defendants, holding that Armco could not recover the monies that it had voluntarily paid. The issue of Lester's alleged negligence was not litigated. This result was affirmed by the Court of Appeals for the Fifth Circuit. Armco, Inc. v. Southern Rock, Inc., 696 F.2d 410 (5th Cir.1983). In defending this action, Lester alleged that he incurred costs, expenses, and attorney's fees of $52,763.12, and this lawsuit is based upon Lester's attempt to recover that money on his theory of indemnification.
Lester's claim was based on the assertions that: 1) the reimbursement was due as being incurred pursuant to the Special Engineering Services, Special Project Administrative Services and/or Related Services clauses of the 1968 Agreement; and 2) that, in the alternative, the indemnification of Lester was required as part of the principal/agent relationship of Richland to Lester. Richland responded by way of a motion to dismiss under Rule 12(b)(6) of the Mississippi Rules of Civil Procedure. The motion alleged that: 1) Richland had no contractual responsibility to pay Lester; 2) Miss. Code Ann. § 31-5-41 prohibited indemnification from negligence as against public policy; 3) Lester was not an agent, but an independent contractor; and 4) Richland, as a public body, was not statutorily authorized to reimburse Lester.
The trial court sustained the 12(b)(6) motion. In its order, the court found that no conceivable set of facts could support the contention that Lester was not an independent contractor, and that neither the 1976 Contract nor the 1968 Agreement contained express indemnity provisions. However, *1187 the court gave Lester 30 days to amend its complaint.
Lester amended Count II of his complaint to further specify the limitations on its authority from Richland, in order to show that Lester was not an independent contractor. Richland reiterated its prior grounds to move to dismiss, and also moved for a summary judgment. In support of the latter motion, Richland submitted an affidavit from Lester Spell, Chairman of the Richland Water and Sewer District. Spell asserted that Lester designed and supervised the construction of the sewage system, that the Board of Commissioners depended on Lester to accomplish the goal of completion of the system, that Richland did not control the means by which construction was accomplished, that it was interested in the ultimate result, and that Richland did not direct Lester to take any specific action with regard to the system.
In opposition to the motion for summary judgment, Lester filed the affidavit of Horace Lester, President of Lester Engineering. Lester stated that his firm was designated and acted as Richland's authorized representative on the project, that Richland had the authority to approve or disapprove work, that Lester presented documents to Richland for approval, that Richland specifically approved change orders, and that Richland exercised control over the means to construct the system.
The trial judge issued an order granting summary judgment in favor of Richland, and dismissed Lester's complaint with prejudice. He found that "as a matter of law under the facts of this case, the defendant has no liability to indemnify an independent contractor rendering professional engineering services for expenses incurred in successfully defending a suit brought by a third party arising from the manner in which the professional services were rendered."

I. DISMISSAL UNDER 12(b)(6)
As this Court held in Busching v. Griffin, 465 So.2d 1037, 1039 (Miss. 1985), "A motion to dismiss under MRPC 12(b)(6) tests the legal sufficiency of the complaint ... . to grant this motion there must appear to a certainty that the plaintiff is entitled to no relief under any set of facts that could be proved in support of the claim." On the face of the pleadings filed in this case, we cannot say that dismissal under this standard was proper.
Lester argues that the 1968 Agreement covers his expenses in defending the Armco suit under the special engineering services, special project administrative services, and related services provisions. We believe that there is an issue here which is not susceptible of resolution on the face of the pleadings. The record indicates that, of the $52,763.12 requested by Lester, $18,456.40 was for indirect engineering services, and $34,306.72 was for attorneys' fees. Whether the indirect engineering services were to be reimbursed under the 1968 Agreement depended upon construction of the contract, which was improperly disposed of on a 12(b)(6) motion. Such an issue must, necessarily, be resolved by reference to matters, such as the intent of the parties, outside the pleadings, and, therefore, dismissal of Count I of the appellant's complaint on a 12(b)(6) motion was erroneous.
Likewise, the issue of whether Lester was to be indemnified as an agent under the 1976 Contract could not be resolved only by resort to the pleadings. Lester was clearly designated under the contract as the authorized representative of Richland. Whether the nature of his representation of Richland during the project made him an agent or an independent contractor was an issue of fact, subject to proof outside the allegations made in the complaint and the response. For that reason, dismissal on Count II of the complaint on a 12(b)(6) motion was also erroneous.

II. SUMMARY JUDGMENT
The only amendment Lester made to its complaint after the 12(b)(6) dismissal was an attempt to further define the relationship *1188 of Lester and Richland on the construction of the sewage system. We read the amendment as an attempt by Lester to show, on the face of the pleadings, that there was an issue with regard to whether Lester was an agent or an independent contractor. The affidavits submitted by the parties for and against summary judgment deal solely with the nature of Lester's duties under the 1976 Contract, and this was the issue before the trial judge on the motion for summary judgment.
In Turner v. Williams, 257 So.2d 525, 526 (Miss. 1972), this Court held, "The relationship of principal and agent is factual and its existence, in the absence of express terms creating the relationship, is one of fact to be determined by a jury [cites omitted]." [emphasis added] The determinative question, we held in that case, was the exercise of control by the principal. Id.
In this case, Mr. Spell alleged in his affidavit that Richland had no control over Lester Engineering; Mr. Lester alleged in his affidavit that Richland exercised final control over the project. Clearly, the issue of control presented a factual dispute that was inappropriate for resolution on a motion for summary judgment. As we stated in Dennis v. Searle, 457 So.2d 941 (Miss. 1984), "Issues of fact sufficient to require denial of a motion for summary judgment obviously are present where one party swears to one version of the matter in issue and another says just the opposite." Id. at 944. Because the matter in issue in this case, the relationship of Lester and Richland, was placed before the trial judge in two diametrically opposed affidavits, we hold that his granting of summary judgment on this issue of fact was premature. In such a case, the only recourse offered by Rule 56 of the Mississippi Rules of Civil Procedure is to proceed to a trial on the merits.
Finding reversible error in this case, we reverse and remand to the circuit Court for a trial on the merits.
REVERSED AND REMANDED.
WALKER, C.J., ROY NOBLE LEE and HAWKINS, P.JJ., and PRATHER, ROBERTSON, SULLIVAN, ANDERSON and GRIFFIN, JJ., concur.
