
337 N.W.2d 424 (1983)
215 Neb. 145
STATE of Nebraska, Appellee,
v.
Leo A. MILLER, Jr., Appellant.
No. 82-711.
Supreme Court of Nebraska.
August 5, 1983.
*425 Robert M. Cook, Norfolk, for appellant.
Paul L. Douglas, Atty. Gen., and Ralph H. Gillan, Asst. Atty. Gen., Lincoln, for appellee.
KRIVOSHA, C.J., and BOSLAUGH, McCOWN, WHITE, HASTINGS, CAPORALE, and SHANAHAN, JJ.
PER CURIAM.
After trial to a jury the defendant was convicted of burglary and sentenced to imprisonment for 10 years after having been determined to be an habitual criminal. He has appealed and contends the trial court erred in refusing his request to instruct the jury as to the lesser-included offense of criminal trespass.
The record shows that the defendant was found inside Ted's Cafe in Norfolk, Nebraska, at about 1:30 a.m. on July 4, 1982. The cafe had been closed since about 2:30 p.m. on July 3. The screen on the outside rear door had been torn away and the glass in the door had been broken. A file cabinet in the cafe had been ransacked and moneybags in one of the drawers had been moved about. The owner had checked the cafe shortly before the defendant was found in the cafe and nothing had been disturbed at that time.
The defendant testified that on the night of the burglary he was upset over his relationship with his girl friend. He had been drinking heavily and smoking marijuana. He did not recall the events of the evening, nor why he entered the cafe. He testified that he did not believe he intended to steal anything, as he had other money with him. When asked why he was in Ted's Cafe, he answered, "I believe I wanted to get sent to jail. I had no place to go. I came back from Colorado to find out my girlfriend is seeing another guy. I just felt like there was nothing left." On cross-examination he admitted that he had broken into Ted's Cafe and stolen money from the cash register in 1977.
The jury was instructed only as to the elements of burglary. The defendant requested that the jury be instructed on criminal trespass in the first and second degrees, but the requested instructions were refused. The defendant was found guilty of burglary and, because of three prior burglary convictions, was found to be an habitual criminal pursuant to Neb.Rev.Stat. § 29-2221 (Reissue 1979).
The principal issue on the appeal is whether criminal trespass is a lesser-included offense of burglary. The test for determining whether a lesser-included offense exists was stated in State v. Lovelace, 212 Neb. 356, 359, 322 N.W.2d 673, 675 (1982). "`A lesser included offense is one *426 which is necessarily established by proof of the greater offense. [Citation omitted.] To be a lesser included offense, the elements of the lesser offense must be such that it is impossible to commit the greater without at the same time having committed the lesser. [Citation omitted.] ....'" See, also, State v. Mackey, 200 Neb. 549, 264 N.W.2d 430 (1978); State v. Colgrove, 197 Neb. 375, 248 N.W.2d 780 (1977).
In Lovelace, supra, we held that the determination of whether an offense is a lesser-included offense is controlled by the elements of the crimes as set forth in the statutes and not by the facts presented in the particular case at issue. All elements of the lesser offense must be included in the greater offense.
The statutes involved in the present case provide: "(1) A person commits burglary if such person willfully, maliciously, and forcibly breaks and enters any real estate or any improvements erected thereon with intent to commit any felony or with intent to steal property of any value." Neb.Rev.Stat. § 28-507 (Reissue 1979).
"(1) A person commits first degree criminal trespass if, knowing that he is not licensed or privileged to do so, he enters or secretly remains in any building or occupied structure, or any separately secured or occupied portion thereof." Neb.Rev.Stat. § 28-520 (Reissue 1979).
"(1) A person commits second degree criminal trespass if, knowing that he is not licensed or privileged to do so, he enters or remains in any place as to which notice against trespass is given by:
"(a) Actual communication to the actor; or
"(b) Posting in a manner prescribed by law or reasonably likely to come to the attention of intruders; or
"(c) Fencing or other enclosure manifestly designed to exclude intruders." Neb.Rev.Stat. § 28-521 (Reissue 1979).
"It is an affirmative defense to prosecution under sections 28-520 and 28-521 that:
"(1) A building or occupied structure involved in an offense under section 28-520 was abandoned; or
"(2) The premises were at the time open to members of the public and the actor complied with all lawful conditions imposed on access to or remaining in the premises; or
"(3) The actor reasonably believed that the owner of the premises or other person empowered to license access thereto would have licensed him to enter or remain; or
"(4) The actor was in the process of navigating or attempting to navigate with a nonpowered vessel any stream or river in this state and found it necessary to portage or otherwise transport the vessel around any fence or obstructions in such stream or river." Neb.Rev.Stat. § 28-522 (Reissue 1979).
The defendant contends that both burglary and criminal trespass require proof that the defendant entered the premises with no right to be on the premises. Thus, criminal trespass is a lesser-included offense of burglary, since criminal trespass must necessarily be proven to establish burglary.
It is possible to commit burglary without also committing criminal trespass because of the peculiar provisions of the criminal trespass statute. For example, it is possible to burglarize an abandoned building, but the fact that the building was abandoned is an affirmative defense to trespass under § 28-522. Since it is possible to commit the greater offense without at the same time committing the lesser, the lesser offense is not included within the greater under the rule of State v. Lovelace, 212 Neb. 356, 322 N.W.2d 673 (1982).
The trial court was not required to instruct as to either first degree or second degree criminal trespass. The judgment of the District Court is affirmed.
AFFIRMED.
BOSLAUGH and McCOWN, JJ., concur in the result.
