
118 N.H. 128 (1978)
SEAWARD CONSTRUCTION COMPANY, INC.
v.
CITY OF ROCHESTER
No. 7868.
Supreme Court of New Hampshire.
March 10, 1978.
Shaines, Madrigan & McEachern, of Portsmouth (Gregory D. Robbins orally), for the plaintiff.
William B. Cullimore, of Farmington, by brief and orally for the defendant.
PER CURIAM.
This is an action on a contract to install certain sewer pipe for the city of Rochester. Defendant's motion to dismiss was granted by the trial court and plaintiff's exception was transferred by Loughlin, J.
On or about January 22, 1974, the plaintiff and the defendant entered into an agreement for the installation of certain sewer pipe. Plaintiff was to be paid $19 per linear foot of pipe installed at a depth of zero to ten feet and $60 per linear foot of pipe laid *129 at a depth of ten to eighteen feet. The written agreement between the parties contained the following provisions:
2. All monies due under the Contract are subject to the receipt of said monies by said Rochester Housing Authority from the Federal Housing and Urban Development Agency (HUD) and turned over to said City of Rochester for payment of the construction of said facilities.
* * * *
5. The City of Rochester shall be under no legal obligation to advance any of its own funds for said construction.
6. Payment to said Seaward Construction Company, Inc. is contingent upon receipt of funds by the Rochester Housing Authority and turning same over to the City of Rochester for payment to said Seaward Construction Company.
During the course of construction Seaward periodically made claims for what ultimately amounted to over 1,000 feet of pipe at a depth of ten to eighteen feet. The city eventually claimed that 920 feet of this pipe was less than ten feet deep. Seaward made formal claim for this disputed footage, but the city refused to pay. Plaintiff instituted this suit in assumpsit based on the agreement to pay $60 per foot. It alleged that the city had paid only at the rate of $19 per foot and claimed a balance due of $37,638. The defendant moved to dismiss on the basis of the above-quoted provisions of the agreement alleging that it had no funds from the Rochester Housing Authority or HUD for payment of the claim. The defendant has not sought or pursued the availability of further funds because of the underlying dispute as to the depth of the pipe. After hearing, this motion was granted, and plaintiff's exception was transferred.
[1, 2] In every agreement there exists an implied covenant that each of the parties will act in good faith and deal fairly with the other. Griswold v. Heat Corp., 108 N.H. 119, 124, 229 A.2d 183, 187 (1967). The mere fact that the defendant is a city does not release it from this implied obligation to act in good faith and deal fairly with the plaintiff. See Leary v. City of Manchester, 90 N.H. 256, 257, 6 A.2d 760, 761 (1939).
[3] The express language in the agreement is perfectly clear that the city will not be required to expend its own funds for payment *130 of the installation of the sewer line, but it is also reasonably clear that the city was under an implied obligation to make a good-faith effort to obtain funds from HUD to pay the plaintiff. Rochester Park, Inc. v. City of Rochester, 38 Misc. 2d 714, 238 N.Y.S.2d 822, 826-27 (1963), aff'd, 19 App. Div. 2d 776, 241 N.Y.S.2d 763 (1963); Public Market Co. v. Portland, 171 Ore. 522, 588-89, 130 P.2d 624, 649-50 (1942).
The defendant's motion to dismiss raises an affirmative defense based on the above-quoted language of the contract. See Armstrong v. Johnson Motor Lines, Inc., 12 Md. App. 492, 496, 280 A.2d 24, 29 (1971). To be entitled to the benefit of the express provisions of the contract, the defendant has the burden of showing that it has also complied with the implied obligation by making a good-faith effort to obtain additional funds from HUD to pay whatever is found to be due plaintiff. See Buzzell v. Snell, 25 N.H. 474, 481 (1852).
The city denies any obligation to seek additional funds because it denies there is anything due plaintiff even if funds were available. However, this places the plaintiff in an impossible position. If the plaintiff is not afforded an opportunity to prove that its pipe measurement is correct, then, under the defendant's contention, there is no obligation on the part of the city to make the good-faith effort to obtain the funds. Plaintiff should be given the opportunity to prove its case on the depth of the pipe in order to bring the city's implied obligation into play.
We have no way of knowing what the length or complexity of a trial of this factual issue regarding the depth of pipe would be. If the trial would be protracted, it would seem a waste of time and effort to try the issue if no funds would be available from HUD. The city may elect to make a good-faith effort to determine whether such funds would be available if the plaintiff should prevail, and if the trial court is satisfied that no funds are available it may give judgment for the defendant. Otherwise the plaintiff should be permitted to try the issue of the depth of the pipe, and if it prevails, the city will be liable unless it proves that, given a reasonable time, it has made a good-faith effort to obtain the funds from HUD and it has been unsuccessful.
Remanded.
LAMPRON, J., did not sit.
