
127 N.W.2d 131 (1964)
William E. SIMONTON, Petitioner,
v.
Hon. W. L. HUISKAMP, Judge First Judicial District, Respondent.
No. 51143.
Supreme Court of Iowa.
March 10, 1964.
Evan Hultman, Atty. Gen. of Iowa, John H. Allen, Asst. Atty. Gen., for respondent.
William E. Simonton, petitioner, per se and Leo Ballard, of Des Moines, for petitioner.
PETERSON, Justice.
This is a certiorari action challenging the decision of a Judge in the Lee County District Court as to its denial of a writ of habeas corpus.
I. Petitioner was tried and convicted by a jury in Polk County of the crime of sodomy and on April 30th, 1957, was sentenced to a term of ten years in the Iowa State Penitentiary. The conviction was appealed to this court. While the appeal was pending the petitioner was arrested in Dallas County for two crimes of assault with intent to commit a felony, and carrying a concealed weapon. The Dallas County authorities were also contemplating charging the petitioner with being an habitual criminal. A Des Moines attorney, Mr. Don Hise, represented petitioner in the Des Moines case and petitioner asked him to go to Dallas County and see what he could arrange with reference *132 to the two charges against petitioner in Dallas County and particularly with reference to the contemplated charge of being an habitual criminal.
Mr. Hise negotiated with the Dallas County authorities and succeeded in making an arrangement, subject to the approval of petitioner, that a plea of guilty be made in the two pending cases, fixing a five year consecutive sentence in each case, and providing the appeal to this court in the sodomy case be dismissed. Defendant accepted the proposal.
During the January 1959 term of the District Court of Lee County, petitioner filed a petition for a writ of habeas corpus, alleging he was denied his right of appeal from the sodomy conviction and was, therefore, denied due process of law. An extended hearing was held in Lee County. Several witnesses appeared. Petitioner herein called his attorney Don Hise. He testified as to every facet of all three cases, and as to the agreement, accepted by petitioner. After such hearing the writ of habeas corpus was denied. Petitioner herein again filed a petition for writ of habeas corpus in the same court on July 19th, 1959, which petition was also denied.
On May 17th, 1963, petitioner filed another petition for writ of habeas corpus in Lee County alleging he had completed two terms of imprisonment and was being unlawfully confined under conviction for carrying a concealed weapon. He claimed his arrest on such charge was unlawful. That it was made without a warrant and that the weapon involved in the case was obtained by virtue of an unlawful search. Petitioner attached to, and made a part of, his 1963 petition for writ of habeas corpus, a complete copy of all evidence taken in the hearing on his petition in 1959. On May 21st, 1963, respondent entered judgment against petitioner denying the writ of habeas corpus and finding that petitioner had voluntarily entered a plea of guilty on the charge of carrying a concealed weapon on September 26th, 1957, and that no evidence, seized legally, or illegally, was used against him. Petitioner filed a motion to alter the judgment on June 1st, 1963, which motion was overruled by respondent on June 6th, 1963. Petitioner brought this certiorari proceeding on June 10th, 1963, claiming the writ of habeas corpus was wrongfully denied. On July 16th a writ of certiorari was issued by this court, pursuant to the petition, and a return was duly filed by respondent on August 5th, 1963. Petitioner's principal claim is that the trial court denied his petition for a writ of habeas corpus without a hearing.
II. As stated in the facts above set out, petitioner filed two previous applications for writs of habeas corpus in 1959. The complete proceedings in the first case in 1959 were set out and attached to the 1963 petition for writ of habeas corpus. The trial court had such proceedings before it. In such proceedings all questions with reference to petitioner's claimed alleged errors appeared. It is true that in the first petition for writ of habeas corpus the alleged errors in the sodomy trial were emphasized. In the 1963 petition the alleged errors in the concealed weapon case were emphasized. The trial court in its decision in the 1963 habeas corpus case made this observation: "The court finds that the only new item raised by the petition for habeas corpus filed May 17, 1963 is the fact that some of the evidence was obtained by an illegal search and seizure, which was used against him at the time of his conviction in Dallas County on September 26, 1957. The court finds that the plaintiff entered a plea of guilty on September 26, 1957, and the evidence, if illegally obtained, was not used against him."
In support of his contention that his constitutional rights were violated in connection with the concealed weapon case petitioner cites the following two cases: Wong Sun v. United States, 371 U.S. 471, 83 S.Ct. 407, 9 L.Ed.2d 441; Smith v. Bennett, 365 U.S. 708, 81 S.Ct. 895, 6 L.Ed.2d 39.
*133 The cases do not support petitioner's claim for the reason that the facts are not in any manner analogous.
In view of the two previous habeas corpus proceedings of petitioner, and in view of the fact that evidence was received at length in the 1959 proceeding, and all such evidence was before the trial court in the 1963 proceeding, it was not necessary that another hearing be held. The evidence and the facts brought out at such hearing, if held, would be a repetition of the testimony in the 1959 habeas corpus proceeding. Nothing new could have been brought out because all facts were explored and the circumstances of the plea of guilty to the charge for carrying concealed weapons were fully explained. What the trial court did in the 1963 case constituted a hearing.
The trial court in the 1963 habeas corpus proceeding also found as follows: "The court further finds that habeas corpus should not be used as an appeal and cannot be brought piece-meal."
We have recently affirmed this statement in three cases: Mahar v. Lainson, 247 Iowa 297, 72 N.W.2d 516, 519; Mann v. Lainson, 250 Iowa 529, 94 N.W.2d 759, 760; Nelson v. Bennett, Iowa, 123 N.W.2d 864, 866.
In the Mann case this court said: "The rule is well settled that it is not the purpose of a habeas corpus proceeding to determine the guilt or innocence of the prisoner of the crime charged, nor to pass upon the errors in his trial, nor to retry the facts and pass upon the sufficiency of the evidence to sustain the charge. Unless there was no jurisdiction in the court, the judgment is not void and may not be collaterally attacked by habeas corpus."
The trial court properly denied the issuance of writ of habeas corpus to petitioner. The writ of certiorari in this case should be and is annulled.
Writ annulled.
All Justices concur.
