
643 N.W.2d 205 (2002)
CITY OF MARION, Iowa, Appellant,
v.
IOWA DEPARTMENT OF REVENUE AND FINANCE, Appellee.
No. 00-1309.
Supreme Court of Iowa.
April 3, 2002.
Rehearing Denied April 26, 2002.
Donald C. Hoskins, Marion, for appellant.
Thomas J. Miller, Attorney General, Harry M. Griger, Special Assistant Attorney General, and James D. Miller, Assistant Attorney General, for appellee.
CARTER, Justice.
The City of Marion (the city) challenges the imposition of a sales tax on its municipal swimming pool admission fees. The city contends Iowa Code section 422.45(20) (1997) exempts admission fees paid for entrance to the city pool from the collection of sales tax. After reviewing the record and considering the arguments, we conclude municipal swimming pool admission fees are not exempt from the collection of sales tax under section 422.45(20). Consequently, we affirm the decision of the district court.
The facts of this case are essentially undisputed. The city owns and operates the Marion municipal swimming pool. The Iowa Department of Revenue and Finance (the department) conducted an audit of the pool's gross receipts for admission fees from January 1, 1993, through December 31, 1997. After completion of the audit, it was determined that the city owed $23,140.90 in sales tax, penalties, and interest.
*206 The department issued a notice of assessment. Although the city paid the assessment, it did so under protest and subsequently requested a refund of the tax that it had paid. A contested-case hearing was held, and the denial of the tax refund was sustained by an administrative law judge. The city appealed that decision to the department director, who upheld the denial of its claim for refund. That decision was affirmed by the district court on a petition for judicial review.
The exemptions for the collection of sales tax are set forth in Iowa Code section 422.45, which states in relevant part:
There are hereby specifically exempted from the provisions of this division and from the computation of the amount of tax imposed by it, the following:
....
20. The gross receipts from sales or services rendered, furnished, or performed by a county or city. This exemption... does not apply to fees paid to cities and counties for the privilege of participating in any athletic sports.

(Emphasis added.) The exception from the exemption with regard to "participating in any athletic sports" was added to section 422.45(20) by a 1985 amendment. 1985 Iowa Acts ch. 32, § 84.
Following this amendment, the department revised Iowa Administrative Code rule 701-18.39 to accommodate the legislative changes. Pursuant to the procedures set forth in Iowa Code section 17A.4, the department received written comments and held a public hearing on the proposed rule changes. After review of the proposed rule by the legislative rules review committee, rule 701-18.39 was amended to read, in relevant part:
Sales or services rendered, furnished, or performed by a county or city.... On and after July 1, 1985, the gross receipts from fees paid to cities and counties for the privilege of participating in any athletic sports are also subject to tax....
A "sport" is any activity or experience which involves some movement of the human body and gives enjoyment or recreation. An "athletic" sport is any sport which requires physical strength, skill, speed, or training in its performance. The following activities are nonexclusive examples of athletic sports: Baseball, football, basketball, softball, volleyball, golf, tennis, racquetball, swimming, wrestling, and foot racing.
The following is a list of various fees which would be considered fees paid to a city or county for the privilege of participating in any athletic sport, and thus subject to tax under this rule. The list is not exhaustive.
1. Fees paid for the privilege of using any facility specifically designed for use by those playing an athletic sport: fees for use of golf course, ball diamond, tennis court, swimming pool, or ice skating rink are subject to tax. These fees are subject to tax whether they allow use of the facility for a brief or extended period of time, e.g., a daily fee or season ticket for use of a swimming pool or golf course would be subject to tax....
Iowa Admin. Code r. 701-18.39 (emphasis added).
Rule 701-18.39 represents the department's interpretation of section 422.45(20). Although the court gives weight to the department's interpretation, the meaning of a statute is always a matter of law to be determined by the court. Sorg v. Iowa Dep't of Revenue, 269 N.W.2d 129, 131 (Iowa 1978). The deference that should be accorded to the view of the agency in this case is prescribed in Iowa *207 Code section 17A.19(11) (2001). That statute provides that the court
[s]hall not give any deference to the view of the agency with respect to whether particular matters have been vested by a provision of law in the discretion of the agency.
Iowa Code § 17A.19(11)(a). The court should, however, give appropriate deference to the view of the agency
with respect to particular matters that have been vested by a provision of law in the discretion of the agency.
Iowa Code § 17A.19(11)(c).
There is a statutory directive, which states:
The director shall have the power and authority to prescribe all rules not inconsistent with the provisions of this chapter, necessary and advisable for its detailed administration and to effectuate its purposes.
Iowa Code § 422.68(1). We conclude from this statute that the matter under consideration has been vested in the discretion of the agency. Consequently, the agency's interpretation of the statute is entitled to the deference accorded by section 17A.19(11)(c).
The city seeks to show that the agency's interpretation of the rule is not within the meaning of the statute by resort to dictionary definitions. Relying on Webster's New Twentieth Century Dictionary [date not provided], it sets forth a definition of "sport" that includes "any activity or experience that gives enjoyment or recreation; pastime; diversion." The city recognizes that recreational swimming is a sport but urges that it is not an "athletic" sport. In support of that claim, they refer to the same dictionary that defines "athletic" as "of, like or proper to athletes or athletics," and defines "athlete" as "one trained to engage or compete in exercises, games, and contests requiring physical strength, endurance, agility, speed, etc."
It is the city's contention that the exception to the tax exemption only relates to competitive athletics. In a Louisiana sales tax case, City of Lake Charles v. Dave's Swedish Spa Resort, 441 So.2d 50 (La.Ct. App.1983), the court rejected a similar contention, stating:
Facilities which increase one's athletic abilities are athletic facilities, whether or not one chooses to use his increased athletic abilities competitively. These facilities are designed to, and presumably do, increase one's strength and stamina, cause loss of excess weight, and in general, improve one's physical fitness.
City of Lake Charles, 441 So.2d at 53.
We recognized in Davenport Community School District v. Iowa Civil Rights Commission, 277 N.W.2d 907 (Iowa 1979):
We thus conclude that when a "rational" agency could conclude that a rule is within its delegated authority a reviewing court should not reach a contrary conclusion. This, of course, would not allow an administrative body to act beyond or in contravention of the language of its enabling act, or contrary to legislative intent.
Davenport Cmty. Sch. Dist., 277 N.W.2d at 910. Giving deference to the view of the agency as required by subpart (c) of section 17A.19(11), we are satisfied that in deciding this issue a rational agency could conclude that the challenged rule is within the statutory mandate.
Our views as to the meaning of the statute are strengthened by the fact that the agency rule has existed for nearly seventeen years. It was vigorously challenged by the Iowa League of Municipalities at the time it was proposed but was not curtailed by the legislative rules review *208 committee. The legislature has exhibited no interest in changing it during the ensuing years. We have recognized that if the meaning of the statute that is subject to administrative implementation is subject to doubt and has been made the object of a rule of long-standing, we should give weight to the administrative interpretation. Clarion Ready Mixed Concrete Co. v. Iowa State Tax Comm'n, 252 Iowa 500, 507, 107 N.W.2d 553, 558 (1961); N.W. States Portland Cement Co. v. Bd. of Review, 244 Iowa 720, 733, 58 N.W.2d 15, 23 (1953). The district court was correct in upholding the agency's rule.
Because the city has not prevailed in this litigation, we need not determine the issue involving its right to recover attorney fees from the agency. We have considered all other issues presented and conclude that the judgment of the district court should be affirmed.
AFFIRMED.
