Strolling through the halls of Potomac Falls High School last week, Loudoun County Sheriff's Deputy Ritchy Fowler grinned at a lanky boy waiting for class to begin.

"Hey, whatcha doin'?" Fowler asked.

"Walkin' the halls looking for drugs and stuff," the student teased.

"If you find any, let me know," Fowler shot back.

A moment later, Fowler poked his head into a turquoise locker as a girl arranged photos she had taped on the door. "You have all those pictures up already," he said. "Where's the picture of me?"

Then Fowler popped into a student council meeting to joke with a student whom he had pulled over during summer vacation.

By the time the second day of school came to a close, one student had handed Fowler a letter detailing how she hoped to persuade her brother--a fugitive--to return to the county and surrender to deputies. A government teacher whose students wondered whether people could get in trouble for forging a signature on a report card asked Fowler to teach a class about the legal consequences. And Fowler stopped in a sociology class for a spontaneous chat on traffic law.

As safety continues to be a priority in schools nationwide, more and more police officers are assigned to beats that consist solely of a school. In the past year alone, the federal government has spent $70 million to help put 600 officers in schools across the country.

Like Fowler, many of these cops--known as school resource officers--play a role that goes far beyond that of a security guard.

"You have people who are coachlike figures of friendship and counseling," said Lawrence W. Sherman, a University of Pennsylvania professor who has taught criminology. "Depending on the officer, he can help break up fights, defuse disputes and encourage kids not to commit truancy. They can make a difference."

This year for the first time, all high schools and middle schools in Loudoun and Alexandria will have full-time officers. Prince William and Fairfax counties added officers in their schools. And Prince George's County police are waiting to hear whether they will be awarded federal grant money to help fund 20 positions, one for each county high school.

Fowler and other school officers say that their first priority is to keep the students safe and that the best way to do that is to get to know the students. Most visit classrooms each day, walk the halls between periods and show up at football games, concerts and dances.

"You have to sell yourself," said Fowler, 31. "You can't have an attitude like you do on the street. If you yell at the kids, they'll hate you, and they won't talk to you."

As the officers get to know the students, they find that youngsters stop in their offices to report rumors of brewing fights, weekend field parties or drugs in the school. But mostly the students come by when they're upset about breakups with their sweethearts, feeling depressed or in the middle of an argument with their parents.

"I'm really more of a counselor than anything," said Officer Hassan Aden, of the Alexandria police. "Sometimes all these kids need is for someone to listen."

As for the students, many welcome having another adult around to talk to, said Potomac Falls senior Holly Obispo.

"Deputy Fowler is pretty cool, and he's really funny," Obispo said. "We think it's kind of cool that we have a cop here. A lot of people don't mind talking to him about things, and I don't know anyone who talks to the principal."

Police departments began putting officers in schools in the 1950s, but the practice has taken off in recent years as a series of high-profile shootings in schools focused nationwide attention on school safety, according to the Raleigh, N.C.-based Center for the Prevention of School Violence.

Lt. John Collier, who heads the Prince William Police Department's school officer program, in 1974 became one of the Washington area's first officers assigned to schools. Back then, Collier said, the officers split their time among several schools, and most wore street clothes.

"There was a period where nobody really knew what to do with us, and we had to forge those relationships," Collier said.

Now, the National Association of School Resource Officers has 5,000 members and is growing every day, said the group's president, David K. Mankin, an officer in Rowlett, Tex.

Although school officers are increasingly popular, the federal government and states have only recently started offering training programs to help officers move from the streets to the classroom.

A few weeks before he exchanged his first high-fives with students at Potomac Falls, Fowler joined Aden and dozens more officers and school officials at a state-run seminar in Roanoke.

Sgt. Hal Moser, of the Chesterfield County police, who oversees 21 school officers, began one session with video taken after the shooting at Columbine High School. When Moser asked group members what they needed to consider if a shooting or bomb threat should happen in their school, the responses rang out.

"How do we account for students, find out who's where?" one principal said.

"Jurisdiction," said another. "Who's in charge?"

"Parking, how do we bring the emergency crews in?" an officer added.

Back in their schools, some of the officers have added security cameras, conduct emergency drills and keep several copies of the floor plan on hand.

In Fowler's tiny office--a utility closet that houses the building's loudspeaker system--a video screen records images of the building's perimeter so intruders are easily spotted. Caller identification boxes flash and record the number of every phone call coming into the building.

Officer John Lavely, of the Prince William police, who works at Gar-Field High School, said that many members of the public and even his colleagues on patrol don't realize that responding to emergencies is only part of his job.

Lavely regularly meets with students to talk about the effects of drugs and alcohol, the county's curfew law and the legal system. Fowler teaches a class on fingerprinting and DNA testing and even shows his students how to dust for prints. Aden last year visited social studies classes at a middle school to talk about growing up in Italy and his extensive travel in Europe.

"We're trying to prevent things from happening," Aden said. "Nowadays a lot of students are faced with issues of trust with adults. What we want to do is help reinstill that."

CAPTION: Loudoun County Sheriff's Deputy Ritchy Fowler, a school resource officer assigned to Potomac Falls High School, greets sophomores Nicki Ford and Jennifer Narbot, right.

CAPTION: Loudoun County Sheriff's Deputy Ritchy Fowler holds a lunchroom door for students at Potomac Falls High School, where he monitors the lunch period.

CAPTION: Fowler on school policing: "You can't have an attitude like you do on the street. If you yell at the kids, they'll hate you, and they won't talk to you."