
456 S.E.2d 527 (1995)
20 Va. App. 285
COMMONWEALTH of Virginia
v.
Tyrone Edgar WATERS.
Record No. 2337-94-4.
Court of Appeals of Virginia, Alexandria.
May 2, 1995.
*528 Kathleen B. Martin, Asst. Atty. Gen. (James S. Gilmore, III, Atty. Gen., on brief), for appellant.
Lorie E. O'Donnell, Asst. Public Defender, for appellee.
Present: BAKER, BRAY and FITZPATRICK, JJ.
FITZPATRICK, Judge.
Tyrone Edgar Waters (appellee) was indicted for possession of cocaine in violation of Code § 18.2-250 and possession of a firearm while in possession of cocaine in violation of Code § 18.2-308.4. Appellee filed a motion to suppress the gun, the cocaine, and his statements because the police officer seized him without reasonable suspicion of criminal activity. The trial court granted the suppression motion, and the Commonwealth appeals that ruling pursuant to Code § 19.2-398(2).[1] On appeal, the Commonwealth argues that: (1) the stop of appellee did not constitute a fourth amendment seizure, and (2) even if appellee was seized, the stop was valid as a *529 community caretaker function under Barrett v. Commonwealth, 18 Va.App. 773, 447 S.E.2d 243 (1994) (en banc). We hold that the initial stop was a reasonable exercise of the officer's community caretaker function and that the drugs and gun were appropriately seized.

BACKGROUND
On March 8, 1994 at 10:15 p.m., Detective Ricky Frye (Frye) of the Leesburg Police Department was patrolling an apartment complex. He saw appellee swaying and walking unsteadily. Appellee appeared to be intoxicated or ill. Frye was concerned for appellee's safety, followed him, and tapped him on the shoulder. Frye told appellee that he was concerned for appellee's safety and that he wanted to make sure appellee could find his way home.
During the initial encounter, Frye smelled a strong odor of alcohol on appellee, who then made threatening gestures and statements to Frye. Frye saw a bulge on appellee's left side and, because appellee was acting violently, asked if he could search him for safety reasons. Appellee immediately pulled his pants pockets inside out and consented to the search. Frye's pat-down revealed a BB gun and a corncob pipe with an odor of marijuana. Frye arrested appellee and read him his Miranda rights. Appellee admitted using the pipe to smoke marijuana. The police tested the corncob pipe and found cocaine residue.
In a pretrial motion, appellee moved to suppress the gun, the pipe, and his statements to Frye as being the products of an unlawful stop. In a November 2, 1994 letter opinion, the trial court granted appellee's suppression motion and found that: (1) the community caretaker exception of Barrett was limited to automobile stops, and (2) appellee was improperly seized within the meaning of the fourth amendment because a reasonable person would not have felt free to leave when approached by the officer.

COMMUNITY CARETAKER EXCEPTION
The Commonwealth argues that Frye's stop of appellee was justified because he was "in the routine execution of community caretaking functions, totally divorced from the detection or investigation of crime." Barrett, 18 Va.App. at 776, 447 S.E.2d at 245. Frye was an officer performing the legitimate role of the police to aid those who reasonably appear to be in distress or need assistance. Appellee argues that the community caretaker exception of Barrett is limited solely to automobile stops, and that, even if it is applicable in other contexts, this stop was unreasonable. Assuming without deciding that appellee was seized by Frye, we agree with the Commonwealth that, under these facts, Frye's initial contact with appellee was valid as a reasonable community caretaker action.
The United States Supreme Court first adopted the community caretaker doctrine in Cady v. Dombrowski, 413 U.S. 433, 93 S.Ct. 2523, 37 L.Ed.2d 706 (1973). The Supreme Court held as follows:
Local police officers, unlike federal officers, frequently investigate vehicle accidents in which there is no claim of criminal liability and engage in what, for want of a better term, may be described as community caretaking functions, totally divorced from the detection, investigation, or acquisition of evidence relating to the violation of a criminal statute.
Id. at 441, 93 S.Ct. at 2528. In Barrett, this Court relied on Cady and held that "officers may conduct investigative seizures in the routine execution of community caretaking functions, totally divorced from the detection or investigation of crime, so long as those seizures are reasonable." 18 Va.App. at 776, 447 S.E.2d at 245.
[T]he duty of the police embraces the function of maintaining public order and providing necessary assistance to persons in need or distress. An officer who harbors a reasonable and articulable suspicion, based upon observed facts or a credible report, that a citizen is in distress or in need of assistance, may lawfully effect an appropriately brief and limited seizure for the purpose of investigating that suspicion and rendering aid.
Id. at 778, 447 S.E.2d at 246.
While many cases interpreting the community caretaker function involve application of *530 the exception to police contact with motor vehicles, no language in Barrett or Cady restricts an officer's community caretaking actions to incidents involving automobiles. See id. at 776-78, 447 S.E.2d at 245-46; Cady, 413 U.S. at 439-47, 93 S.Ct. at 2527-30. As noted in Barrett, "[o]ther jurisdictions have acknowledged that the duty of the police extends beyond the detection and prevention of crime, to embrace also an obligation to maintain order and to render needed assistance," 18 Va.App. at 777, 447 S.E.2d at 245, and have addressed the community caretaker doctrine in contexts other than automobile stops. See State v. Dube, 655 A.2d 338 (Me. 1995); State v. Menz, 75 Wash.App. 351, 880 P.2d 48 (1994), review denied, 125 Wash.2d 1021, 890 P.2d 463 (1995).
In Dube, a custodian requested the police to accompany him into the defendant's apartment to verify that the custodian only fixed a leak. 655 A.2d at 339. There was no prior indication of any criminal conduct, but once in the apartment, the officers saw evidence of child abuse and neglect in plain view. Id. The Supreme Judicial Court of Maine held that the officers were lawfully in the apartment as part of their community caretaking functions "totally divorced from the detection, investigation, or acquisition of evidence relating to the violation of a criminal statute." Id. at 340. The court noted that "a police officer has a `legitimate role as a public servant to assist those in distress and to maintain and foster public safety.'" Id. (quoting State v. Pinkham, 565 A.2d 318, 319 (Me.1989)). It would be illogical to allow the police to render assistance to a convulsing man in a car while denying this same assistance to a man on the street.
The appropriateness of applying the community caretaker doctrine to a given factual scenario is determined by whether: (1) the officer's initial contact or investigation is reasonable; (2) the intrusion is limited; and (3) the officer is not investigating criminal conduct under the pretext of exercising his community caretaker function. Police officers have an obligation to aid citizens who are ill or in distress, as well as a duty to protect citizens from criminal activity. The two functions are unrelated but not exclusive of one another. Objective reasonableness remains the linchpin of determining the validity of action taken under the community caretaker doctrine.
No seizure, however limited, is a valid exercise of the community caretaking function if credible evidence indicates that the stop is a pretext for investigating criminal activity. A separate opinion in Barrett, concurring with the adoption of the doctrine but finding the facts there insufficient to warrant its application, warned that "[t]he `community caretaking' exception should be cautiously and narrowly applied in order to minimize the risk that it will be abused or used as a pretext for conducting an investigatory search for criminal evidence." 18 Va.App. at 780, 447 S.E.2d at 247 (Coleman, J., dissenting). The trial judge in this case specifically did "not question the motives of Detective Frye." In State v. Fry, 122 Idaho 100, 831 P.2d 942 (Ct.App.1991), the Court of Appeals of Idaho determined that the police officers were not exercising their community caretaker function when they seized a truck parked in a parking lot. Id. 831 P.2d at 946. The court noted that: (1) neither officer "entertained any belief that Fry needed police assistance, nor did they perceive a medical emergency or other exigency compelling their immediate action," and (2) the officers' "purpose in encountering Fry was related to their subjective suspicions of Fry's presence and his possible connection with ... recent burglaries." Id. We agree that credible evidence of pretext or subterfuge will invalidate a stop made under the guise of the community caretaking exception.
We hold that an officer's community caretaker functions are not limited solely to automobile stops and that, under the facts present in this case, Frye's actions were a reasonable exercise of that duty. If a police-citizen encounter is based upon an objectively reasonable belief that aid or assistance is warranted and contraband or other evidence of crime is discovered incident to the lawful performance of an officer's duties, the officer need not ignore that which is discovered. Frye observed appellee staggering late at night, and based on this observation, Frye had a reasonable suspicion that appellee was *531 intoxicated, ill, or in need of help. Frye's initial contact with appellee was brief and limited to voicing his concern and making a determination whether appellee was in distress. While attempting to determine if appellee was ill, Frye smelled alcohol, and appellee made threatening gestures and statements. The nature of the encounter then changed, and Frye, seeing a bulge on appellee's left side, reasonably believed that a pat-down search for weapons was necessary for his safety. See Terry v. Ohio, 392 U.S. 1, 30, 88 S.Ct. 1868, 1884, 20 L.Ed.2d 889 (1968).
For the foregoing reasons, we reverse the trial court and remand for trial.
Reversed.
NOTES
[1]  Code § 19.2-398 provides, in pertinent part, that:

A petition for appeal from a circuit court may be taken by the Commonwealth only in felony cases ... from:
* * * * * *
2. An order of a circuit court prohibiting the use of certain evidence at trial on the grounds such evidence was obtained in violation of the provisions of the Fourth, Fifth or Sixth Amendments to the Constitution of the United States or Article I, Sections 8, 10 or 11 of the Constitution of Virginia.
