The opinion of the court was delivered by
This case presents the question of whether the state of Kansas may compel testimony from an unwilling witness, who invokes the constitutional privilege against compulsory self-incrimination, when witness immunity from prosecution or punishment is conferred by the state as provided in K. S. A. 22-3415 (Weeks).
The question arose under the following circumstances. Ed Mufich was charged with commercial gambling. The appellant Paul Birdsong was called as a state witness at the preliminary hearing and refused to respond to questions, claiming a constitutional privilege against compulsory self-incrimination under the Fifth Amendment to the United States Constitution and under Section 10 of the Kansas Bill of Rights. The district attorney then gave appellant a written grant of immunity pursuant to K. S. A. 22-3415 (Weeks) which reads as follows:
“To: Paul C. Birdsong
“Grant of Immunity
“Comes now Nick A. Tomasic and states:
“1. That I am the duly elected, qualified and acting District Attorney for the 29th Judicial District, State of Kansas; and
“2. That pursuant to K. S.A. 1972 Supp. 22-3102 and 22-3415, I have the power to grant immunity from prosecution to any person; and,
“3. That I, in my officeial capacity as District Attorney, herewith grant to Paul C. Birdsong full and complete immunity from prosecution or punishment on account of any transaction or matter contained in any statement or about which such person may be compelled to testify and such statement or testimony shall not be used against such person in any prosecution for a crime under the laws of Kansas or any municipal ordinance; and,
“4. That the aforedescribed grant of immunity is given for the purpose of compelling testimony from Paul C. Birdsong in the prosecution of the above styled action.”
*299Appellant Birdsong persisted in his refusal to answer questions asserting that the immunity granted was insufficient to protect him against prosecution by the federal government. The trial court found that the grant of immunity was sufficient to protect appellant from both state and federal prosecution on any testimony he might give at the preliminary hearing. Appellant continued his refusal to testify, was held in contempt of court and was sentenced to the custody of the sheriff until he testified as ordered by the court. Pending this appeal appellant was permitted to remain at liberty on bond.
Appellant’s primary complaint alleged on appeal is that the immunity granted pursuant to K. S. A. 22-3415 (Weeks) will not protect him against subsequent prosecution for violation of federal laws based upon testimony compelled at this state proceeding. Appellant argues the grant of immunity provided by the state is insufficient to protect against self-incrimination as guaranteed by the state and federal constitutions.
There has been change in this area of constitutional law but it is settled that state and federal governments possess the power to compel residents to testify in courts, before agencies of the government and before grand juries. The power to compel residents to testify is essential to protect the legitimate public interest in the investigation of criminal offenses. See Blair v. United States, 250 U. S. 273, 63 L. Ed. 979, 39 S. Ct. 468, and Murphy v. Waterfront Comm'n., 378 U. S. 52, 12 L. Ed. 2d 678, 84 S. Ct. 1594.
Since the decision of the high court in Malloy v. Hogan, 378 U. S. 1, 12 L. Ed. 2d 653, 84 S. Ct. 1489, the Fifth Amendment right against self-incrimination is applicable to the states through the due process clause of the 14th Amendment. However, the Supreme Court of Kansas has held the provisions of the Fifth Amendment to the United States Constitution grant no greater protection against self-incrimination than does Section 10 of the Kansas Bill of Rights. See State v. Faidley, 202 Kan. 517, 450 P. 2d 20, and State ex rel., v. Koscot Interplanetary, Inc., 212 Kan. 668, 676, 512 P. 2d 416. The Fifth Amendment to the United States Constitution and Section 10 of the Kansas Bill of Rights provide that no person shall be compelled in any criminal case to be a witness against himself.
In order for governments to exercise their power to compel testimony a grant of immunity from prosecution based upon the compelled testimony is necessary and it is generally understood that a *300grant of immunity is sufficient to require the incriminating testimony if the immunity granted is coextensive with the scope of the constitutional privilege against self-incrimination. (Counselman v. Hitchcock., 142 U. S. 547, 35 L. Ed. 1110, 12 S. Ct. 195; Heike v. United States., 227 U. S. 131, 57 L. Ed. 450, 33 S. Ct. 226; Kastigar v. United States, 406 U. S. 441, 32 L. Ed. 2d 212, 92 S. Ct. 1653, reh. den. 408 U. S. 931, 33 L. Ed. 2d 345, 92 S. Ct. 2478.)
In Counselman v. Hitchcock., supra, it is pointed out: “[L] egislation cannot abridge a constitutional privilege, and that it cannot replace or supply one, at least unless it is so broad as to have the same extent in scope and effect. . . .” (142 U. S., p. 585.)
In Kastigar v. United States, supra, it is stated:
“Immunity statutes, which have historical roots deep in Anglo-American jurisprudence, are not incompatible with these values. Rather, they seek a rational accommodation between the imperatives of the privilege and the legitimate demands of government to compel citizens to testify. The existence of these statutes reflects the importance of testimony, and the fact that many offenses are of such a charcter that the only persons capable of giving useful testimony are those implicated in the crime. Indeed, their origins were in the context of such offenses, and their primary use has been to investigate such offenses. . . .” (406 U. S., pp. 445, 446, 447.)
The Kansas statute which grants immunity from prosecution on compelled testimony reads as follows:
“The provisions of law in civil cases relative to compelling the attendance and testimony of witnesses, their examination, the administration of oaths and affirmations, and proceedings as for contempt, to enforce the remedies and protect the rights of the parties, shall extend to criminal cases so far as they are in their nature applicable, unless other provision is made by statute.
, “The county or district attorney or the attorney general may at any time, on behalf of the state, grant in writing to any person immunity from prosecution or punishment on account of any transaction or matter contained in any statement or about which such person shall be compelled to testify and such statement or testimony shall not be used against such person in any prosecution for a crime under the laws of Kansas or any municipal ordinance. After being granted immunity from prosecution or punishment, as herein provided, no person shall be excused from testifying on the ground that his testimony may incriminate him unless such testimony is a violation of federal law. He shall not be granted immunity from prosecution for perjury or false statement or any other crime committed in giving such evidence.” (K. S.A. 22-3415 [Weeks].)
Appellant earnestly argues that the immunity granted by the statute is not coextensive with the constitutional privilege against self-incrimination because the grant of immunity does not extend to subsequent federal criminal prosecutions.
*301The questions raised in appellant’s argument appear to be answered, to our satisfaction at least, in Murphy v. Waterfront Commn., supra, where the high court reviewed the early English and American cases and the recent cases of the Supreme Court of the United States and said:
“The foregoing makes it clear that there is no continuing legal vitality to, or historical justification for, the rule that one jurisdiction within our federal structure may compel a witness to give testimony which could be used to convict him of a crime in another jurisdiction.” (378 U. S., p. 77.)
The court went on to say that it was going to decide what effect this might have on existing state immunity legislation. We quote that decision:
. . [W]e hold the constitutional rule to be that a state witness may not be compelled to give testimony which may be incriminating under federal law unless the compelled testimony and its fruits cannot be used in any manner by federal officials in connection wih a criminal prosecution against him. We conclude, moreover, that in order to implement this constitutional rule and accommodate the interests of the State and Federal Governments in investigating and prosecuting crime, the Federal Government must be prohibited from making any such use of compelled testimony and its fruits.18 [Footnote.] 18Once a defendant demonstrates that he has testified, under a state grant of immunity, to matters related to the federal prosecution, the federal authorities have the burden of showing that their evidence is not tainted by establishing that they had an independent, legitimate source for the disputed evidence. [End of footnote.] This exclusionary rule, while permitting the States to secure information necessary for effective law enforcement, leaves the witness and the Federal Government in substantially the same position as if the witness had claimed his privilege in the absence of a state grant of immunity.” (378 U. S., p. 79.)
An argument similar to that of the appellants was made in Nelson v. Municipal Court, 28 Cal. App. 3d 889, 105 Cal. Rptr. 46, where witnesses in a state criminal proceeding sought a writ of prohibition to restrain the court from imprisoning them for refusing to testify after they had been granted immunity by the state. They argued that their answers might subject them to prosecution under federal law. The California court reviewed the Murphy v. Waterfront Commn. decision and stated that since the federal government would be barred from using any of the testimony, or its fruits, in a subsequent federal prosecution, because the witnesses had been granted immunity pursuant to the California statute, they may therefore be compelled to testify. We believe the California court correctly interpreted the Murphy decision.
Appellant next questions the Kansas immunity statute because *302of the specific language in the statute. He argues that the grant of immunity in the statute is restricted to a grant of immunity against self-incrimination in state prosecutions.
The statute (K. S. A. 22-3415 [Weeks].) has previously been set forth in full in this opinion. In the second paragraph of the statute the legislature designates who is authorized to grant immunity from prosecution (the county or district attorney or the attorney general). The written grant of immunity from prosecution may be made “on account of any transaction or matter contained in any statement or about which such person shall be compelled to testify.” Then follows a rather ambiguous and unclear statement which gives rise to appellant s concern. It is as follows:
“. . . After being granted immunity from prosecution or punishment, as herein provided, no person shall be excused from testifying on the ground that his testimony may incriminate him unless such testimony is a violation of federal law. He shall not be granted immunity from prosecution for perjury or false statement or any other crime committed in giving such evidence.” (K. S. A. 22-3415 [Weeks], Emphasis added.)
The Malloy v. Hogan and Murphy v. Waterfront Commn. cases were decided in 1964. The ambiguous portion of the Kansas statute was added by the legislature in 1972, after the federal law in this area had been clarified. If we accept the premise stated by the high court in Kastigar v. United States, supra, that state and federal immunity statutes are not incompatible and they seek a rational accommodation between the imperatives of the constitutional privilege and the legitimate demands of government to compel citizens to testify, then it becomes necessary for us to interpret our immunity statute. Under any rational interpretation it cannot mean that testimony may be compelled in state prosecutions only when the testimony could not be relevant to a federal prosecution. Such an interpretation would destroy the legitimate demands of state govenment to compel citizens to testify and would make any state statutory grant of immunity wholly ineffective. Rarely will you find a need for compelled testimony where the transaction will not involve state as well as possible federal infractions of the law.
The requirement to testify in the statute is predicated on a grant of immunity “unles such testimony is a violation of federal law.” The giving of testimony can be a violation of law when it is perjured. However, the final sentence in the statute withholds immunity for any crime committed in giving such testimony, such as *303perjury or false statement. The meaning of this “unless clause” is obscure.
The statute provides that no person shall be excused from testifying after immunity has been granted. The federal cases hold that unless the grant of immunity is in some way limited so as not to be coextensive with the constitutional privilege against self-incrimination the testimony may be compelled. In other words it would appear the legislature intended that any witness who- had been granted the immunity contemplated by the Kansas statute could be compelled to testify. If the written grant of immunity contains no limitations which limit the constitutional privilege against self-incrimination or render the witness subject to federal prosecution the witness may be compelled to testify. The grant of immunity pursuant to the Kansas statute (K. S. A. 22-3415 [Weeks].) affords a witness protection from self-incrimination in state prosecutions and under the federal case law a similar protection from federal prosecutions is afforded on account of any transaction or matter contained in any statement or about which such witness shall be compelled to testify. Such compelled statement or testimony shall not be used against such witness in any prosecution for a crime, state or federal.
The Supreme Court of Delaware in construing a similar provision in the Delaware witness immunity statute (11 Del. C. § 3508) arrived at a similar interpretation of their “unless clause” holding that because such testimony cannot be used in evidence in a subsequent federal proceeding when full immunity has been granted the limiting language of the Delaware statute was inapplicable (State v. Conner, [Del. Supr.] 295 A. 2d 704.) We believe that such an interpretation could reasonably be adopted by this court as to the Kansas statute.
The appellant, anticipating the foregoing interpretation of the statute, states that the motive or wisdom of legislation rests with the legislature and relief from an undesirable enactment is a legislative and not a judicial function. That principle is sound and is applied in cases where the legislative intention is clear. In the present case the words used in the “unless clause” of the statute are ambiguous, unclear and unintelligible when read in conjunction with the other provisions of the statute. Therefore judicial construction and interpretation is necessary. Our construction should be based on legislative intent to be determined from the whole act and construction should be in accord with the general intent and purpose of the entire statute. (Southwest State Bank v. Quinn, 198 Kan. 359, 424 *304P. 2d 620.) The general intent and purpose of the statute is to obtain compulsory self-incriminating testimony by granting immunity from prosecution coextensive with the constitutional privilege against self-incrimination. Legislative intent, if ascertainable from the statute, governs its construction even though the literal meaning of the words used therein is not followed. (In re Estate of Diebolt, 187 Kan. 2, 13, 353 P. 2d 803; Duggan v. Navart, 198 Kan. 637, 639, 426 P. 2d 153.)
Appellant next argues that the Kansas statute provides protection from subsequent prosecution by authorizing a grant of transactional immunity (immunity from prosecution for or on account of any transaction, matter or thing concerning which a witness may testify or produce evidence documentary or otherwise). Appellant contends that the high court in Kastigar v. United States, supra, held that use and derivative use immunity (immunity from use of compelled testimony or evidence and its fruits in subsequent prosecution) is required to compel testimony from a witness in federal proceedings. Appellant argues that because Kansas provides transactional immunity the legislature adopted limiting language to protect witnesses compelled to testify in state actions from subsequent federal prosecution for crimes related to the transaction about which they were compelled to testify. Appellant presents no authority which holds that federal prosecutors may prosecute witnesses based on testimony of transactions about which they testified while under the protection of a state grant of transactional immunity. Appellant’s interpretations of K. S. A. 22-3415 (Weeks) and of Kastigar v. United States, supra, are erroneous.
A grant of immunity pursuant to the Kansas statute is as follows:
[Ijmmunity from prosecution or punishment on account of any transaction or matter contained in any statement or about which such person shall be compelled to testify and such statement or testimony shall not be used against such person in any prosecution for a crime under the laws of Kansas or any municipal ordinance. . . .” (K. S.A. 22-3415 [Weeks]. Emphasis added.)
It appears from our reading of the statute that both a transactional immunity and a use immunity is provided. Under the Kansas statute (K. S. A. 22-3415 [Weeks].) immunity is granted on account of any transaction or matter about which such person is compelled to testify (transactional immunity). In addition the statute provides that such testimony shall not he used against such person in any prosecution for crime (use immunity).
*305Appellant contends Commonwealth, Appellant v. Fattizzo, 223 Pa. Superior Ct. 378, 299 A. 2d 22, holds that transactional immunity does not provide every protection that use and derivative immunity affords. In view of our interpretation of the Kansas statute the contention is academic since our statute provides both transactional and use immunity. However, it is generally held that a grant of transactional immunity alone is coextensive with a witness’ constitutional privilege against self-incrimination and when transactional immunity is granted the witness must testify. (Kastigar v. United States, supra; Zicarelli v. New Jersey Investigation Comm’n, 406 U. S. 472, 32 L. Ed. 2d 234, 92 S. Ct. 1670; State v. Carroll, 83 Wn. 2d 109, 515 P. 2d 1299; People v. Breindel, 342 N. Y. S. 2d 428, 73 Misc. 2d 734.)
Finally appellant argues that at the time he refused to testify he had reasonable grounds to fear that the immunity granted by the state would not protect him against subsequent federal prosecution. He argues that he should not be held in contempt because of the confusion in the law in this area. We cannot agree. The opinion in Murphy v. Waterfront Comm’n., supra, was available and appears sufficiently definite and certain. We find no merit to this contention.
The judgment of the trial court finding appellant in contempt is affirmed.