GRANADA, NICARAGUA -- Interior Minister Toma's Borge, guardian of state security, took hold of the cowering cab driver.

"You are Andre's Castro!" he said sternly, as a phalanx of white-shirted functionaries stood by and watched. A mild breeze freshened the moist night air. Bats skittered crazily under a glowering moon. At such moments, detachments of Borge's secret police have been known to rout enemies of the revolution from their beds. But not on this night, not here. Not at all.

Instead the short, stout comandante was trying his hand at directing a movie -- or at least a scene in which the character Andre's Castro, a 19th-century Nicaraguan patriot, smashes a gringo imperialist in the head with a large rock. "Walker," nominally directed by Alex Cox, with Ed Harris starring opposite Marlee Matlin, allegorizes the true story of William Walker, a Tennessee-born adventurer who invaded Nicaragua in the mid-1850s and installed himself briefly as president. "The Gray-Eyed Man of Destiny" in his day, he now occupies one of history's more modest nooks. But for Borge and his Sandinista companåeros, the theme has a certain resonance.

So, having dropped by the set to watch, Borge artlessly took charge. "He grabbed the cab driver by the shoulders," recalled Hollywood actor Xander Berkeley, playing Byron Cole of President Walker's high command, "stared him straight in the eye, and basically told him that it was with absolute passion that he must reenact this important historical event of killing me with a rock."

The man was plainly ill at ease in the role of national hero -- unlike Borge, who was soon demonstrating how the assassin should be portrayed. It was, Berkeley said, "a kind of Greek drama performance."

He started by glaring at Berkeley -- not quite capturing the scene's undercurrent of fear, but certainly its prevailing mood of confrontation. Berkeley turned away to retrieve an imaginary pistol, at which Borge bent down to pick up an imaginary rock. Holding it aloft, he lunged at the actor, bringing it down decisively on the nape of his neck. Berkeley crumpled to the ground. A crowd of onlookers applauded.

The casting director, Miguel Sandoval of Los Angeles, had a sudden inspiration. "Why don't you play Andre's Castro?" he asked Borge.

"No, no, I'm sorry," the comandante replied, the dignity of his office getting the better of his love of show biz.

"Pop on the costume," Sandoval persisted, "we'll give you a beard, and no one will know it's you."

Borge smiled. "Oh, yes, they will."

Eight years ago, when the Sandinistas banished the American-backed dictator Anastasio Somoza after a bloody insurrection -- an event now billed as "The Triumph" -- they blazoned the party letters, FSLN, on a hill overlooking Managua. A pretty sight in a city that seems to have been permanently disfigured by an earthquake, it might easily be confused with the HOLLYWOOD sign (notorious of late as the OLLYWOOD sign since the H was obscured in honor of Ollie North).

"We shall not submit to imperialism," vowed the Sandinista slogan, duly displayed in all the government buildings, including an airy house in Managua expropriated by the Nicaraguan film commission In Cine for use as a production office by the "Walker" expeditionary force. "We will continue ahead in the struggle for peace."

Against the havoc wreaked daily by the antigovernment rebels known as contras, the film and the struggle in some minds became one and the same. Freshly exposed reels were flown not to Los Angeles but to London to be processed, to avoid, as Alex Cox put it, "those porkers in Immigration." Then there was the ominous tale, told by a business partner of the production accountant, of an early-morning phone interrogation by someone claiming to be with Pacific Bell. It came the day after a call to Managua about a shipment of prop muskets via Aeroflot, with stops in Moscow and Havana.

"William Walker was an expression of North American policy in the sense that he considered it was his destiny to conquer this land and put all the countries of Central America at the service of North Americans," said In Cine director Ramiro Lecayo. "But more important than William Walker is that the military experience of an invasion will be very painful for both countries, for Nicaragua and the United States. We want to avoid this prospect. This is why we supported the film."

It was not only predictable but inevitable that Tinseltown and Sandinoland would be caught in such an epic embrace, owing perhaps to a reciprocal regard for glamor, a commodity Nicaraguans call "angel," and for passion. Maybe it was this happy affinity -- or maybe it was all the garbage fires smoking heavenward in the countryside -- that made it impossible to distinguish anything ersatz in the lower atmosphere as the "Walker" people hunkered down this spring for two months of movie make-believe.

"I find it almost abrasive," said actor Rene Auberjonois of his second visit to Nicaragua -- his first was with a delegation of Hollywood activists -- in the midst of one of the epiphanies into which he was apt to sail at any moment. "I find it very hard to deal with the country, with the poverty. It's like Munich before the war. There's something that's decadent and strange, burnt-out and punch-drunk and tragic. But I have come to see how strangely beautiful, heartbreakingly beautiful, it is."

"Aside from the fact that it is politically, economically, hygienically and geologically unstable," said another member of the cast, Keith Szarabajka, "it's a wonderful place to visit."

The visitors could be found in the fancy restaurants flourishing stacks of thousand-cordoba notes, half a dozen waiters enlisted to count them out, as befits an annual inflation rate of 700 percent. Auberjonois raided the government bookstores "for my internacionalista friends." His arms filled with knick-knacks and posters, he said, "Ed Asner will love these things."

They were easily identified by their "Walker" T-shirts ("Here nobody surrenders"), although not everyone harbored such sympathies. "I'm just as likely to put on a Somoza T-shirt," said British sound operator Dave Batchelor. "As far as the common man is concerned, the revolution doesn't matter one little jot. A lot of the people working on this film, I'm sorry to say, are poolside pinkos."

The loquacious Luis Contreras, playing one of Walker's soldiers, was struck dumb when a drunken patron approached him in a bar. "For all I know," the Nicaraguan told the American, "you're the guy that paid for the gun that killed my brother."

"But it wasn't me," Contreras said later. "I didn't buy the bullet. It's not like I had a choice in the matter." Snubbing out a cigarette, he added, "If I ever came to live in this country, I know what I would invest my money in -- ashtrays."

"It's a bit like Africa, and these rival tribes," said British film editor David Martin of the conflict between the Sandinistas and the contras. "Every time you go out you see kids gathering around you for food and money. It's the white man's burden," he sighed.

Martin wanted desperately to return to London to finish the rough cut, but the director insisted on staying in Nicaragua -- where he has been on and off, holed up in a rented villa in Granada and editing away. "In a funny way," Cox said, "I think we have kind of a duty not to just be the rich gringos and come down here and spend eight weeks and then disappear."

Suddenly Nicaragua's booming bureaucracy, which often seems to aspire to Bulgarian efficiency, was a model of ingenuity. A fleet of 40 taxis? Can do. An air-conditioned bus? No problem. Portable toilets? "I'm sorry about that," said Cox. "I don't know what happened with the toilets."

Even when the enterprise involved spiriting telephone poles from downtown Granada (knocking out service to the hapless few who could afford it), burying city streets in tons of dirt, erecting a 300-foot-long 19th-century fac ade only to set it ablaze, mutating a dock on Lake Nicaragua into San Francisco circa 1855 and staging thunderous battles between American interlopers and Nicaraguan defenders, the effect was strangely organic.

Ditto when the "Walker" art department minted funny money featuring Ed Harris' face -- no less valuable than the cordoba -- and similarly adorned covers of anachronistic news mags: Newsweek ("Nicaragua's Liberator -- Peace in Central America") and Time ("Nicaragua -- A New Future"). Also in evidence were camera-ready mock-ups of El Nicaraguense, the English-language newspaper of Walker's brave new nation. "President Walker Decrees Slavery," it announced. "Nicaraguans Rejoice!"

The screenplay, written by journeyman Rudy Wurlitzer with an ear for comic opera, received high-level vetting from Vice President Sergio Ramirez, a noted novelist, and Minister of Culture Ernesto Cardenal, a prominent poet, who sometimes dropped by the set along with his brother Fernando, the minister of education, the redoubtable Borge and the odd military commander.

"The Nicaraguans have been enthusiastic supporters and congenial hosts," said executive producer Edward Pressman, who is steering the picture toward a November release by Universal Pictures. This extraordinary collaboration, plus the actors' willingness to work at cut rates (Harris was reported to be getting a tenth of his usual fee), had allowed a $20 million spectacular to be made on a $6 million budget.

The dying economy got a palpable boost. Nicaraguans were well represented on the production's 130-person payroll, some 300 local carpenters were enlisted to build the monumental sets (which required the virtual commandeering of the nation's extant lumber supply), and nearly 6,000 others, from peasants to soldiers, were hired on as extras. The army provided logistical support, deploying security guards and even supplying, for another anachronistic grace note, a Soviet-built MI-18 transport helicopter. Its cabin was still bloodstained from carrying wounded from the war zone near the Honduran border.

That, unfortunately, was not the only intimation of mortality. Just south of Guatemala City, as a caravan of 18-wheelers was hauling heavy equipment from Mexico, the lead rig broadsided a pickup truck parked astride the highway and a Guatemalan was killed. A few weeks later, during filming in San Juan del Sur on Nicaragua's southwestern coast, a horse was spooked by a truck as it passed on a narrow dirt road, throwing its rider, a 10-year-old boy, under a rolling wheel. The movie company paid for the funeral and compensated the family. Afterward people didn't talk about it much. Then the news shuddered through the cast and crew that a young American named Benjamin Linder had been executed by contras somewhere up north.

"It is somewhere in my mind," Contreras said as he sat on a poolside terrace at the Intercontinental Hotel in Managua, where he often could be found hoisting the local beer, and the occasional tequila, occasionally at breakfast. (Sometimes it seemed as though the movie were a remake of "Under the Volcano.") "I'm probably very foolish to be here," he added. "But I gotta die some day."

In his black trousers, black vest and black coat, his face hidden under a big black hat, Ed Harris looked sullen, a man of mystery. During a break in the filming late one night he was sitting by himself on a sidewalk in Granada, intent on a reviewer's copy of "Where is Nicaragua?"

"What's the name of our ambassador to Nicaragua?" he called out.

"Harry Bergold," a production assistant replied.

"Gary?"

"Harry."

"What's he like?"

"He, off the record, is critical of the administration, but on the record he toes the line."

"Oh," Harris scoffed. "He plays that game."

"Otherwise he wouldn't be here," Auberjonois put in sensibly.

Harris went back to his book. "I've been here for 10 weeks," he admitted, "and I'm only at Page 60."

"I have figured out why Nicaragua must survive," announced stunt man J.D. Silvester.

"Why is that?" someone asked.

"To connect North and South America."

William Walker was born a Nashville banker's son in 1824 and died 36 years later, by firing squad, on the north coast of Honduras. These were the heady days of "manifest destiny," the doctrine stating that it was the fate of the United States, ordained by God, to gain dominion over the Western Hemisphere. The catch phrase was "go ahead." In the decade before the Civil War, the standard-bearers of this expansionist theology were known as "filibusters," who on private initiative mounted armed expeditions against countries with which the government was officially at peace. Walker was foremost among them.

His parents had hoped he would enter the ministry. He took degrees in medicine and law before his "restless intellect," as it was popularly described, drove him to the practice of journalism. He became an editor of a paper in New Orleans, where he conducted his only recorded romance, learning sign language to court a certain Miss Martin, a deaf woman who died young of yellow fever. Walker, grief-stricken, decamped to California, arriving at a San Francisco newspaper in 1850. "What he wrote," said a contemporary observer, "was only distinguished from those around him by terseness of style and an undercurrent of severe thought." Indeed: He flogged a competitor for an unknown editorial offense, and was once shot in the foot during a pistol duel.

In October 1853 he took the rank of colonel, invaded the Mexican territory of Lower California and named himself leader of a new independent republic before being forced to flee for his life. But his greatest adventure was the conquest of Nicaragua, undertaken after he secured the invitation of the so-called Democratic faction, then striving to topple the reigning Legitimists. In May 1855, Walker sailed aboard the aging brig Vesta with a complement of 58 men, unaccountably known ever after as "The 56 Immortals." As these worthies succumbed to cholera, starvation and battle, Walker promoted himself to general, engineered his election as president and, ever the southern gentleman, laid plans to introduce slavery. The whole of Central America's military might was arrayed against him. More significantly, Cornelius Vanderbilt conspired with the British, who controlled Nicaragua's Atlantic Coast, to bring about Walker's downfall. This was after he had terminated the capitalist robber baron's highly profitable transit concession. He burned Granada to the ground before taking his leave. Back in the United States, he hatched plans for a triumphant return. It proved fatal.

"I saw Walker for the first time in San Francisco," wrote Ernesto Cardenal, posing as one of the Immortals in his hallucinatory poem "With Walker in Nicaragua":

I remember him as if I were seeing his blond face like a tiger's;

his grey eyes, without pupils, fixed like a blind man's,

but which expanded and flashed like gunpowder in combat,

and his skin faintly freckled, his paleness, his clergyman's ways,

his voice, colorless like his eyes, cold and sharp,

in a mouth without lips.

Accounts of the movie's progress, peppered with denunciations of the Reagan administration, were splashed over the front pages of the official party organ Barricada and the pro-Sandinista El Nuevo Diario, the only newspapers permitted by decree since last year's government shutdown of the opposition daily La Prensa. "I have feelings," Harris declared, "and I believe that my government is mistaken."

Then there was an ideological gabfest between Nicaraguan journalists and Best Actress Marlee Matlin, lurching from Spanish to English to sign language and back. "ACTRESS WHO WON THE OSCAR ARRIVES," Barricada had proclaimed. She had come to play Walker's deaf amor, but in short order President Daniel Ortega was also smitten, pronouncing her "a messenger of peace."

"Did you see any parallels between Walker and Reagan?" she was asked one afternoon at Managua's Foreign Press Club, formerly the residence of contra leader Adolfo Calero. "Do you feel you'll be more of an activist when you return to the United States?"

"I'm not a politician," Matlin insisted. "I'm an actress and I'm a human being, just as we are all human beings."

"Are you against the policy of the Reagan government in Nicaragua?"

"I think I have to learn more about it."

The Barricada correspondent shrugged when asked to assess the political content of the movie star's remarks. "What political content?" he replied. Still, the headlines tended toward "Matlin: I love Nicaragua!" and "She will tell the truth in her country." One of her fellow actors, erstwhile British punk-rocker Joe Strummer, late of the Clash and its "Sandinista!" album, proposed his own banner head: "DEAF COMMIE WORKS MOVIE."

For some reason, Nicaragua's Fourth Estate persisted in calling her "Marleen."

"It just seems that life's more clear here," said Alex Cox ("Alex Cord" to the readers of El Nuevo Diario), whose northern English accent was leavened by Oxford and UCLA film school, and whose movies "Repo Man," "Sid & Nancy" and "Straight to Hell" possess a clarity that verges on crazed. "Life is more basic here. And that, sometimes, to our citified eyes, appears surreal -- some of the scenes you might see in the road involving people or animals or whatever. The place is a really weird amalgam of stuff."

He sat atop an overturned fishing boat on a white hot beach, to which he'd repaired one Sunday for R&R after a bout of all-night filming. He had arranged his long, skinny frame into a human knot, tied off at the top with a scruffy red bandana (enforcing martial law on his extravagant red mane). His T-shirt proclaimed his membership in the "Anarchist Society of Cinematography."

"In 1978 or 1979, when the revolution was going on, that was the first time I ever heard of Nicaragua," he said, pronouncing the word in the native manner, with a silent "g." "The Los Angeles Times and I think some other major newspapers in the States were very sympathetic toward the Sandinistas and the revolution -- presented them very favorably, published attractive pictures of Sandinistas looking very fashionable in their revolutionary outfits and, you know, guns."

Then came the Reagan Revolution. "It seems like most of the conservative-slash-liberal newspapers went through a change of attitude," Cox said, "and suddenly decided that the Sandinistas were very bad. You know, persecuted the Church, persecuted the Indian population, repressed freedom of speech. Never mind that they were fighting a guerrilla war against American-backed terrorists. No one's perfect."

In interviews with an endless parade of visiting journalists, Cox had been invoking the name of Elliott Abrams, comparing the assistant secretary of state for inter-American affairs to Walker himself, unaware that the pugnacious policy-maker would probably relish the attention. "He likes that, huh?" Cox asked in surprise. "I won't mention his name anymore then. I don't even hardly know the names of these guys. I know there's a guy called William Walker somewhere in there as well," he added, referring to Abrams' serendipitously christened deputy for Central America. While the British charge' d'affaires invited Cox and company to tea, in-country American diplomats discreetly kept their distance.

"He's gotta, like, put up or shut up, man," Cox said of the supposedly conflicted American ambassador. "He's gotta, like, if he cares about that stuff, even if he gets fired, in the long run it'll be better for his conscience and his career if he says what he really thinks." A few weeks later our man in Managua left quietly for a new assignment.

"It is a comedy, not a propaganda film," Cox said, midpolemic. "I don't think people that go to the movies are stupid, but I don't think they want necessarily to be lectured to, either."

The sun plunged languidly into the Pacific, as various of the cast and crew grappled with the undertow. Others lounged in the open-air restaurant a few yards away, washing down plates of shrimp with bottles of beer. The party included Auberjonois, serving as chairman of the beach committee when not playing Walker's aide de camp Major Henningsen; Strummer, living incognito under a straw hat and mangy beard ("The food is always beef, chicken or fish," he said. "I like the simplicity of that"); and visiting pop star Peter Gabriel, who had arrived unexpectedly on his very own Tour Nica bus supplied by the Sandinista Association of Cultural Workers. Here everyone was a cultural worker.

By and by, two indigenous musicians wandered into the restaurant and started performing indigenous music on indigenous instruments. An emaciated, brown-toothed mendicant grinned and danced as the captive audience stuffed cordobas into the entertainers' pockets. Gabriel approached with his Nikon, aimed and clicked away.

"This is what filmmaking is supposed to be like," Cox enthused. "When I was a little kid and I saw movies, I imagined that it would always be going off to some exotic foreign locale in the tropics, with palm trees swaying and the beach and the hotel and the daiquiris. This is kind of like that -- except that there's no daiquiris."

He first visited Nicaragua in 1984, during the national election campaign from which Ortega emerged as president. "I was interested in seeing if it had really become the sort of Pol Pot regime that the newspapers were claiming. And it just wasn't true. It just wasn't true {bleeping} at all."

He said he was persuaded to return by two wounded soldiers in Leo'n, invalided out of the Sandinista army after encounters with the contras -- otherwise known as "freedom fighters," otherwise known as "American-backed terrorists." Later Cox learned of the historical Walker from an article in Mother Jones and determined to bring him to the screen. Now he was at the helm of a major motion picture, directing a cast of thousands at the tender age of 32.

"You don't really think it's a tender age at all, do you?" Cox demanded. "You probably think it's pretty old. William Walker was 30 when he invaded Mexico."

Actually, he was 29.

Col. Walker, actually Harris, stood primly on the poop deck of the Vesta, actually a souped-up cargo boat. "Nothing can stop us now," he declaimed into a boom mike just out of camera range.

It was long past midnight. The colonel was presiding over the Vesta's departure from San Francisco, actually a dock on the Granada side of Lake Nicaragua. Now it was covered with wooden planks, surrounded by vaulting fac ades of wood and brick, piled high with burlap sacks and teeming with people, mules, chickens, horses, even a caged boa constrictor and a tarantula -- giving the place an aura of danger as well as a gamy smell. Dense swarms of insects battered the arc lights. "The sun's coming up soon," Cox yelled. "We'll be able to see the palm trees." Harris coughed deeply and spat on the deck.

"Nothing can stop us now," he repeated, this time with quiet intensity.

"Is that directed to myself?" he wondered. " 'Now has the hour of my destiny come' -- like that?"

"Exactly, Colonel," Cox replied. He was always calling Harris "colonel."

"The guy had a lot of nerve, you know," Harris said later, mulling his character over in a moment of repose. "I don't know if it was nerve or stupidity or a death wish or exactly what it is, but he definitely set his mind on something and went after it." His speech, so precise when he spoke as Walker, was now muddled with the noise of his native New Jersey. "He had, you know, these blinders on. Going straight forward -- obsessed."

Harris had done much to assume the character. He had led the entire cast on a 10-mile forced march through the Nicaraguan countryside. When a bottle of Valpolicella was broken open one night he declined, his nose in his book. (Walker was a teetotaler.) "Walker was not too interested in people," Harris explained. "So I kind of adopted that attitude a little bit."

The shoot had been a difficult one. "There's congestion in my chest. The air down here is pretty bad sometimes. All the fires they're building. The air gets pretty thick. It gets real hard. It's the kind of thing you can't really talk about, it's your survival instincts, whatever gets you through ...

"One thing that's kind of been real nice -- I've been able to explore my patience. And even today, I was supposed to be picked up at 2 o'clock to go to work, I'm the main {bleeping} actor in the film, I waited for half an hour, and finally took a cab to the production office and said, 'Give me a ride down to the set.' That's just the way it is.

"The film is like an adventure, about this bunch of guys who come down to Nicaragua. It's got political overtones but it should be amusing and entertaining and scary, you know, and all kinds of things. Walker should be charismatic. He got 58 guys to follow him down on this boat to Nicaragua for, quote, fame and fortune. So he must have had something going for him."

At the switching of the generators, the set was plunged into darkness. Technicians stumbled around with flashlights, stringing lengths of cable. "I'm afraid," said a Nicaraguan extra named Roger Nelson, a boy of about 16. "I have a premonition that something bad is going to happen." What precisely? "I haven't the least idea, but something bad."

"I don't like this government," said another extra, Julio Bermudez, who used to be a short order cook at a Sizzler steak house in San Francisco, where he lived for 16 years and picked up broken English. "It's no good -- really terrible. Ninety percent of all these people are really scared. With Somoza a lot of people were only a little scared. This government want to take something and play with it. I know a lot of people that are in the government, and they don't like the government. The contra are better. I don't wanna take any rifle or any machine gun against them. I would help the contra. I want the Americans to come."

"He showed throughout the greatest coolness, not even changing color when walking from the prison to the plaza where he was shot," read an account of Walker's execution in Trujillo, Honduras, on Sept. 12, 1860. "Two soldiers, with drawn swords, advanced in front of him, and three, with fixed bayonets, followed him. In his right hand he carried a hat, and in his left a crucifix ... He died at once."

Walker's present-day namesake at the State Department keeps a picture in his office of himself standing on the great man's grave. "He and I actually look somewhat alike -- except for height, of course," said the deputy assistant secretary of state for Central America, a strapping six-footer. "I hope it's going to be a beautiful film, and that they have found someone dashingly handsome to play the part." Some wags at the embassy in Managua once sent up a wire headed, "William Walker: The Movie."

"Certainly he is someone that all Nicaraguans could love to hate," said William Walker: The Diplomat. "But it seems that he was a fairly sympathetic character, dragged into Central America at the request of various Nicaraguan players to further their cause. In many respects this guy was an idealist. He was not a nasty person ... He was almost a Don Quixote sort of figure."

Of the Sandinistas' support for the filmmakers, he said, "I can understand that if they see this as a chance to make a statement about foreigners coming into their territory trying to work their will. I hope they're not making any statement about me."

Toward the end of the shoot, the director sheared his hair. "It was free and I was bored," Cox explained. The new streamlined looked gave him an almost military bearing.

"I was talking to a guy last night, the commander of the nth zona militar, and he said, 'I've been watching this film, and it seems to me that making a film is like running an army, really. Because everything's born out of confusion. There's no real order at all, even though you have a pretense at order. Except that you know that on a certain date, at a certain time, you have to do a certain thing -- and no element can be lacking.'

"Sometimes I get these moments of great elation. Like, riding along with trucks and buses with a whole bunch of Americans in the Nicaraguan countryside, and like, thinking, in a way we are kind of like Walker and his army. Or we're kind of like a whole bunch of jarhead Marines ... except that the good will of the people is upon us.