
201 Va. 412 (1959)
E. WEBSTER ANDREWS, ET AL.
v.
FRED R. SHEPHERD, MAYOR, ETC., ET AL.
Record No. 4995.
Supreme Court of Virginia.
November 30, 1959.
Ralph H. Ferrell, Jr. (E. Milton Farley, III; Thomas L. Clark; Hunton, Williams, Gay, Moore & Powell,    on brief), for the appellants.
No brief filed for the appellees.
Present, All the Justices.
1.  Appellants sought by mandamus to compel the city council of Colonial Heights to establish a second election district.  The city had one only, with 2900 registered voters; whereas Code 1950, section 24-45 provides that "there shall not be less than one election district for every one thousand voters or fractional part thereof above five hundred."  This statute is not merely directory but imposed an imperative duty on the council.  The court below therefore erred in dismissing appellants' petition.
2.  Significant also was the fact that although subsequent to this ruling there had been an amendment of the statute in other particulars, the legislature had not changed the language so construed.
3.  Mandamus is the proper remedy to compel public officers to perform their ministerial duties, but it will not lie to control their discretion as to the detail or manner of compliance.
Appeal from a decree of the Circuit Court of Chesterfield county.  Hon. William Old, judge presiding. The opinion states the case.
I'ANSON
I'ANSON, J., delivered the opinion of the court.
  E. Webster Andrews and others filed their petition for a writ of mandamus to issue against the council of the City of Colonial Heights to require it to establish forthwith an additional election district or districts within the city pursuant to | 24-45, Code of 1950, as amended.  The trial court sustained a demurrer, dismissed the petition, and in a written opinion held that the provisions of the statute are directory and not mandatory; that it does not prescribe any time within which such functions as may be imposed shall be performed, and that mandamus would not lie.
The appellants contend that the trial court erred in sustaining the demurrer and dismissing their petition because the Colonial Heights city council had a mandatory duty under the statute to establish an additional election district or districts since there were more than 1500 voters entitled to vote in the existing, single election district.  Thus the sole question is:  Does the statute make it the mandatory duty of the council to establish an additional election district or is it merely directory?
The appellants' petition alleges that the City of Colonial Heights was chartered as a second class city by the General Assembly in 1950; that it has a population of approximately 9000 inhabitants; that it has approximately 2900 registered voters, of whom approximately 2800 have paid their capitation taxes; that there is only one ward and one election district in the city; that | 24-45, Code of 1950, as amended, imposes upon the city council a duty to establish a second election district whenever the number of voters in the present election district exceeds 1500; that despite several requests to do so the council has refused to establish another election district or precinct^; and that while the city council indicated it might establish an additional district, the one contemplated would not satisfy the requirements of | 24-45, as amended.
Section 24-45, as amended, reads as follows:
"The council of a city    shall establish    for each ward as many election districts as it may deem necessary, and a voting place in each district, except in cities in which officers are elected by wards the council in its discretion may establish election districts, the location of which may be within two or more wards.     Such districts,    except in a *414 city having a population of more than twenty thousand but less than thirty thousand inhabitants,    shall be established so that there shall not be less than one election district for every one thousand voters or fractional part therof above five hundred.     The council shall prescribe and cause to be published the boundaries of the districts.  It may alter the boundaries of any such election district, and rearrange, increase, or diminish the number thereof, and change the voting places or establish others therein, not to exceed, however, one voting place for each election district.  No change shall be made in any of the boundaries or voting places within thirty days next preceding any general election."  (Italics supplied.)
It is elementary that the primary object in the interpretation of a statute is to ascertain and give effect to the intention of the legislature.     Anglin
Joyner,    181 Va. 660, 666, 26 S.E.2d 58, 60; 17 Mich. Jur., Statutes, | 35, p. 284, and cases cited.
The petitioners contend that the word "shall," used throughout the statute and twice in the second sentence, should be given its ordinary and usually accepted meaning of a command and should be construed as mandatory unless a different intention is fairly manifest.     Huffman     Kite,    198 Va. 196, 202, 93 S.E.2d 328, 332;    State     Sims,    138 W.Va. 244, 77 S.E.2d 122, 136, 137.
A statement of this well settled rule is found in 80 C.J.S., Shall, p. 137, where it is said:
"In its ordinary signification, 'shall' is a word of command, and is the language of command, and is the ordinary, usual, and natural word used in connection with a mandate.  In this sense 'shall' is inconsistent with, and excludes, the idea of discretion, and operates to impose a duty which may be enforced, particularly if public policy is in favor of this meaning, or when addressed to public officials, or where a public interest is involved, or where the public or persons have rights which ought to be exercised or enforced, unless an intent to the contrary appears; but the context ought to be very strongly persuasive before it is softened into a mere permission."
In ascertaining whether the legislature intended the word "shall," used in the statute, to be primarily mandatory in its effect or merely directory, the court will consider the subject matter and context.     Pettus     Hendricks, 113 Va. 326, 330, 74 S.E. 191, 193; 39 Words and Phrases, perm. ed., Shall -- In Statutes as Permissive or Mandatory, p. 122, et seq.
The statute uses both the words "shall" and "may."  It is clear, from *415 a reading of it, that where the word "shall" is employed in the second sentence it indicates the legislative intent to impose an imperative duty on the council to establish an election district or districts whenever the number of voters in a district reaches 1501.  The word "may" is used to give the council discretion only in the manner and details of establishing such district or districts.  It would appear, therefore, that the words "shall" and "may" were used advisedly by the legislature and in their usually accepted meanings.  A different conclusion is not fairly manifest from the statute.
  Furthermore, in reply to a question relative to the meaning of the statute, the Honorable J. Lindsay Almond, then Attorney General, in an opinion dated August 20, 1953, said:  "It is reasonably plain, in my opinion, that * * * the language of the section means that an election district does not    have to be divided until the number of voters reaches a total of 1501 * * *." (Italics supplied.)
After the ruling by the Attorney General, | 24-45 was amended and re-enacted, Acts of Assembly, 1954, c. 375, p. 473, specifically excepting "a city having a population of more than twenty thousand but less than thirty thousand inhabitants."
The construction of a statute by the Attorney General is persuasive and entitled to considerable weight.     Barber     City of Danville,    149 Va. 418, 424, 141 S.E. 126, 127.     United States     Graham & Irvine,    (D.C., Va.) 250 F. 499, 502; 17 Mich. Jur., Statutes, | 59, p. 319.  It can also be presumed that the legislature was cognizant of such construction because the statute was amended at its next session following the Attorney General's ruling. Although the legislature has since met in two regular sessions there has been no further amendment.
  It is well settled that mandamus is the proper remedy to compel public officers, including municipal councils, to perform their ministerial duties, but that it will not lie to control or review the acts of public officers and municipal councils in matters in which they have been vested with discretion, in the absence of arbitrary action, or refusal to exercise their discretion. Richmond-Greyhound Lines     Davis,    200 Va. 147, 152, 104 S.E.2d 813, 816, 817; 12 Mich. Jur., Mandamus, | 14, p. 357, | 16, p. 363, 364; 55 C.J.S., Mandamus, | 124, b.(2), p. 212.
Under | 24-45, Code of 1950, as amended, it is the mandatory duty of the city council to establish another election district or districts when the number of voters in the existing district reaches 1501, but *416 it is within the discretion of the council to determine the manner and details for establishing the election district or districts.
When public officials fail to perform their ministerial duty at a time required by law, mandamus will lie to compel the discharge of such duty within a reasonable time thereafter.     Moore     Pullem,    150 Va. 174, 198, 142 S.E. 415, 422.
For the reasons given it was error for the trial court to sustain the demurrer.
The judgment of the lower court is therefore reversed and the cause remanded, with directions to the court to issue a writ of mandamus directed to the mayor and city council of the City of Colonial Heights to establish another voting district or districts within a reasonable time, if the evidence justifies it; but the court shall not direct the manner and details of establishing such voting district or districts, that being within the sound discretion of the city council.
Reversed and remanded.
