
457 N.W.2d 467 (1990)
Greg BRYANT, Floyd Wennberg, and Belle Fourche Irrigation District, Plaintiffs and Appellants,
v.
BUTTE COUNTY, A Political Subdivision of South Dakota, and Butte County Commissioners: Maude Kendrick, Kenneth Kudlock, Francis Walton, Glen Wahlfeldt, in their Representative Capacities, Defendants and Appellees.
No. 16802.
Supreme Court of South Dakota.
Considered on Briefs April 25, 1990.
Decided June 6, 1990.
*468 Kenneth E. Barker of Quinn, Day & Barker, Belle Fourche, for plaintiffs and appellants.
Allen G. Nelson and Mark F. Marshall of Bangs, Mc Cullen, Butler, Foye & Simmons, Rapid City, for defendants and appellees.
MORGAN, Justice.
Belle Fourche Irrigation District (District) appeals a judgment denying issuance of a writ of mandamus against Butte County, a political subdivision of South Dakota, and Butte County Commissioners: Maude Kendrick, Kenneth Kudlock, Francis Walton and Glen Wahlfeldt, in their representative capacity (collectively referred to as County). We affirm in part and reverse and remand in part.
This litigation centers on who should maintain and repair eight bridges situated on section-line highways designated in the *469 County's secondary highway system. County maintained the bridges in the ordinary course of maintaining the highways until about 1983, when it was decided that it could no longer afford to care for these bridges due to dwindling resources and sought to turn their maintenance over to the District. District declined on the grounds that the bridges belonged to County and, together with two landowners, commenced this action.
Between 1878 and 1892, section-line highways were surveyed and platted in the county. A little over twelve years later in 1905, the United States Bureau of Reclamation (Bureau) began construction of the Belle Fourche Irrigation Project (Project). In constructing these works, Bureau found it necessary to construct many bridges to span the project waterways so as not to cut off public rights-of-ways.
The trial court found that the eight bridges were constructed by the Bureau in the course of the construction of the Project; that Bureau turned over operation and maintenance of the Project to District in 1949; and, that the Bureau still owned the bridges, the care and maintenance for which District was responsible. The trial court then denied mandamus upon the grounds that a decision not to repair the bridges was a discretionary act, not susceptible to mandamus and that District had an adequate remedy at law.
District raises the following issues:
(1) Whether the trial court was clearly erroneous in finding that the eight bridges were owned by Bureau and through contract, District was responsible for care and maintenance of these structures; and
(2) Whether the trial court erred as a matter of law in determining that Butte County's decision not to repair the bridges was a discretionary act not susceptible to mandamus and, further, that mandamus was inappropriate because District had an adequate remedy at law.
For reasons which will hereafter become apparent, we will first discuss District's second issue, the propriety of mandamus. We note our standards of review in this case. As to the factual findings made by the trial court, we review them under the clearly erroneous standard. Jankord v. Jankord, 368 N.W.2d 571, 572 (S.D.1985); SDCL 15-6-52(a). More important, "... the credibility of witnesses and weight to be accorded their testimony and the weight of evidence is for the trial court." Insurance Agents, Inc. v. Zimmerman, 381 N.W.2d 218, 219 (S.D.1986). As to any conclusions of law, they are reviewed under the error as a matter of law standard. Wefel v. Harold J. Westin and Associates, Inc., 329 N.W.2d 624 (S.D.1983). And, since the decision as to who should actually pay for and repair the bridges involves interpretation of statutes, we may review that portion of the trial court's decision de novo. Brown v. Egan Consol. School D. 50-2, 449 N.W.2d 259, 260 (S.D.1989). With these standards in mind, we proceed to District's mandamus issue.
Very correctly, the trial court did not deny relief by mandamus upon the grounds of ownership of the bridges, but rather, the trial court denied mandamus on the grounds that County's duty to repair county secondary highways was a discretionary function not subject to mandamus and that plaintiffs had an adequate remedy at law. Therein lies the error.
Two statutes spell out the duty of county commissioners with regard to secondary roads in the county.
SDCL 31-12-19 first provides:
It shall be the duty of the board of county commissioners to maintain properly and adequately the county highway system within the county by contract or day labor on all or different portions of the same as the board of county commissioners may deem most expedient, and to maintain any secondary highways according to any agreement made by it in consideration of federal aid received for construction and improvement of such highways. (Emphasis added.)
While County argues that the phrase "as the board of county commissioners may deem most expedient" gives the commissioners *470 the discretion to choose which roads they repair, we believe this selective reading from the statute misses the point. The phrase merely modifies the county's choice to use contract or day labor on its roads. The "shall" and "duty" language mandates the county's duty to "properly and adequately" maintain the county roads, thus making it clear that the county's duty to repair the road is ministerial. The statutory mandate could not be met if the commissioners are allowed to pick and choose which roads to repair.
This reading is consistent with our cases on statutory interpretation. "`It is a well-recognized rule of statutory construction that, where an affirmative direction is followed by a negative or limiting provision, the negative or limiting clause renders the statute mandatory.'" Rueb v. Lehmann, 73 S.D. 545, 546, 45 N.W.2d 463 (1950) (citation omitted). Moreover, the word "shall" is generally regarded as a mandatory provision. Dunker v. Brown County Board of Ed., 80 S.D. 193, 198, 121 N.W.2d 10, 14 (1963). A statute is considered mandatory especially when giving it a permissive connotation would render the law ineffective. Application of Megan, 69 S.D. 1, 5 N.W.2d 729 (1942).
The legislature left no room for doubt and not only mandated the county's obligation via the word "shall," but also defined the level of maintenance with the words "properly and adequately." If this statute is applied in the permissive connotation, it has virtually no effect. "In construing a statute, this court looks at the intention of the lawmakers as expressed in the plain meaning and effect of the words and phrases used in the statute." Union Insurance Co. v. Farmland Ins. Co., 389 N.W.2d 820, 821 (S.D.1986). The intent of a statute must be derived from the statute as a whole, from its language, and by giving it its plain, ordinary and popular meaning. American Rim & Brake, Inc. v. Zoellner, 382 N.W.2d 421 (S.D.1986).
The mandatory nature of this obligation is reiterated in SDCL 31-12-26, wherein the legislature stated a county's obligation as to secondary roads thusly:
It shall be the duty of the board of county commissioners and county superintendent of highways in organized counties, to construct, repair, and maintain all secondary roads within the counties not included in any city, incorporated town, or organized civil township. (Emphasis added.)
It is undisputed that the roads in question are not part of any city, incorporated town, or organized civil township.
In addition to reliance on statutory interpretation, we can look to our test for whether a government official's actions were ministerial or discretionary as recently reiterated in Gasper v. Freidel, 450 N.W.2d 226, 230 (S.D.1990).
(1) The nature and importance of the function that the officer is performing....
(2) The extent to which passing judgment on the exercise of discretion by the officer will amount necessarily to passing judgment by the court on the conduct of a coordinate branch of government....
(3) The extent to which the imposition of liability would impair the free exercise of his discretion by the officer....
(4) The extent to which the ultimate financial responsibility will fall on the officer ...
(5) The likelihood that harm will result to members of the public if the action is taken....
(6) The nature and seriousness of the type of harm that may be produced....
(7) The availability to the injured party of other remedies and other forms of relief.
Using those criteria, we think that the maintenance of the secondary roads clearly falls within the ministerial category.
While all duties of county commissioners are important, this particular function of maintaining secondary roads has been twice ascribed to them by the legislature. We are not passing judgment on another branch of government, but merely requiring that Butte County Commissioners carry out their duty so prescribed by the legislature. *471 The discretionary function, to use contractors or day labor, remains unimpaired. For reasons which we shall hereafter explain, no financial responsibility will fall on either the commissioners or Butte County. Rather than harm befalling on the public if the action is mandated, the public will be protected by having safe bridges; whereas, if the bridges are not repaired, there is the potential for serious harm to the public crossing any of these structures.
County argues that SDCL 46-8-10 spells out the citizens' adequate relief wherein it provides:
The owner of any works for application of water to beneficial use which may prevent reasonable access to lands crossed or adjacent to the works is responsible for providing reasonable access to the land. If the owner of the works does not provide reasonable access the owner or occupant of the land may construct reasonable access and may recover the costs of constructing access from the owner of the works.
We do not view it expedient for members of the public affected to pay for the repair of the various bridges and later seek reimbursement from District, nor would such a remedy be plain, speedy and adequate. See SDCL 21-29-1. It is County that possesses the equipment to repair bridges and roads. Moreover, the bridges would continue to deteriorate during a trial and long appeal process, leaving the public with an unsafe and impassable roadway. Finally, one of the owners of land that is being obstructed is Butte County, whose secondary roads are being obstructed.
Since the actions requested here are ministerial, it is appropriate for mandamus. Schaller v. Ericson, 49 S.D. 499, 207 N.W. 459 (1927). However, the propriety of the remedy of mandamus requiring that County fulfill its ministerial duties of maintaining the county secondary highways does not end our discussion. The next consideration is who pays for the repairs to those bridges, and that decision centers on who owns them. This brings us to District's first issue as to the ownership of the bridges.
While District still contests the trial court's finding that the Bureau built the bridges, we find that argument vain. The trial court's findings are well supported by the evidence and, indeed, there is none to the contrary. We cannot say that the trial court was clearly erroneous in so finding. District's alternative theories are that the bridges are public highways by virtue of the twenty years of continuous use, work and maintenance as a public highway or that they are along section-line highways and are therefore public highways by operation of law.
We examine alternative one, that Butte County has accepted the bridges because of twenty years of work, use and repair of the bridges. SDCL 31-3-1.[*] Butte County concedes that it has repaired the eight bridges in question and that the public has used these roads for the prescribed period; however, it contends that the federal government may not be deprived of property by adverse possession. We agree.
In United States v. California, 332 U.S. 19, 40, 67 S.Ct. 1658, 1669, 91 L.Ed. 1889, 1990 (1947), the high court ruled that the United States may not lose property by adverse possession, absent properly divesting itself of the property:
The Government, which holds its interests here as elsewhere in trust for all the people, is not to be deprived of those interests by the ordinary court rules designed particularly for private disputes over individually owned pieces of property; and officers who have no authority at all to dispose of Government property cannot by their conduct cause the Government to lose its valuable rights by *472 their acquiescence, laches, or failure to act. (Footnote omitted.)
All of the cases relied upon by District are clearly distinguishable inasmuch as they all involve adverse possession of private property not owned by the federal government.
We also look to two contracts entered into between Bureau and District when District took over the operation of Project in 1949. The 1949 contract retained title to the project works including canals, laterals, drains and "appurtenant structures" in the United States Government, but entrusted care, maintenance, and repair thereof to the District. Again, in 1984, Bureau and District entered into a similar contract. We therefore hold that neither the Bureau nor the District could sit back and permit the County to obtain ownership of the bridges by adverse possession.
As to District's second alternative, County ownership by operation of law, we are equally unimpressed. The trial court determined that all eight bridges were located along section-line highways that were opened by operation of law before the Bureau built the bridges, thus they are on county secondary roads under the supervision of the board of county commissioners. SDCL 31-1-5(4). See Thormodsgard v. Wayne Township Bd. of Supervisors, 310 N.W.2d 157 (S.D.1981) (unless vacated or relocated by lawful action, section-line highways are highways open to public); SDCL 31-18-1.
This does not establish that Butte County owns the bridges. SDCL 46-8-16 would seem to dictate otherwise:
An owner of works for the storage, carriage or application of water to beneficial use has the right to cross any public or railroad right-of-way, subject to such reasonable conditions as may be prescribed by the board or officer having charge of the right-of-way.... The owner of the works shall bear the cost of construction of any bridge, culvert or similar structure where it crosses the right-of-way....
Here, all eight bridges cross Project canals, which mandated that Bureau incur the initial cost of constructing the bridge. While the statute is silent on repair and maintenance, it would seem that the language, "subject to such reasonable conditions as may be prescribed by the board or officer" gives County the right to prescribe that the owner repair its bridges.
Faced with an almost identical statutory dilemmastatute provided water district had to build bridge, but did not mention maintenancea Texas court in Hidalgo County Water C. & Im. Dist. No. 1 v. Hidalgo County, 134 S.W.2d 464 (Tex.Civ. App.1939), read the statute to require maintenance.
Because of the very nature of said intrusion a sort of legal trespassthe statute by express language put the duty upon the district to restore the status quo ante, and by implication, to maintain that status so long as the district obstructs the free use of the county's prior easement.
Id. at 468.
We again look to the two contracts entered into between Bureau and District above referred to. The 1984 contract specifically provided the following:
(a) All Belle Fourche unit project works including the irrigation canals, laterals, drains and appurtenant structures; Belle Fourche diversion dam; and Belle Fourche dam and reservoir were transferred to the district for care, operation, and maintenance under the provisions of a prior contract (no. Ilr-1555) of November 29, 1949. Such project works shall be hereinafter referred to as the transferred works.
(b) The district, without expense to the United States, shall continue to care for, operate, and maintain the transferred works in full compliance with the provisions of this contract, and in such manner that the transferred works will remain in sound operating condition.
(c) Necessary repairs of the transferred works shall be made promptly by the district....
Furthermore, courts have long recognized the duty under common law that the owner of a ditch which crosses a public *473 road or thoroughfare has an affirmative duty to build a bridge, and to also maintain it. State ex rel. City of Livingston v. State Water Conservation Board, 134 Mont. 403, 413, 332 P.2d 913, 919 (1958); Richardson County v. Drainage Dist. No. 1, 92 Neb. 776, 778, 139 N.W. 648, 649 (1913); City of Indianapolis v. Indianapolis Water Co., 185 Ind. 277, 286, 113 N.E. 369, 372 (1916) (even when statute is silent on issue, common law recognizes duty to repair in the nature of a covenant running with the land).
We therefore determine that, while County has the statutory duty of maintaining and repairing the bridges (both by statute and common law), Bureau was required to pay for the repair of the bridges it constructed, a liability which was transferred to District by contract.
We therefore affirm the trial court as to ownership of the bridges, and reverse and remand on the issue of mandamus with instructions to enter an appropriate order in conformity with this decision.
All the Justices concur.
NOTES
[*]  SDCL 31-3-1 provides:

Whenever any road shall have been used, worked, and kept in repair as a public highway continuously for twenty years, the same shall be deemed to have been legally located or dedicated to the public, and shall be and remain a public highway until changed or vacated in some manner provided by law.
